File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,8 +99,10 @@ public function getServiceDefinitionsByTag(string $tag): array
9999 $ builder = $ this ->pass ->getContainerBuilder ();
100100 $ definitions = [];
101101
102+ /** @var array{name: string}|string $tagValue */
102103 foreach ($ builder ->findByTag ($ tag ) as $ serviceName => $ tagValue ) {
103- $ definitions [(string ) $ tagValue ] = $ builder ->getDefinition ($ serviceName );
104+ $ name = is_array ($ tagValue ) ? $ tagValue ['name ' ] : $ tagValue ;
105+ $ definitions [$ name ] = $ builder ->getDefinition ($ serviceName );
104106 }
105107
106108 return $ definitions ;
@@ -114,8 +116,10 @@ public function getServiceNamesByTag(string $tag): array
114116 $ builder = $ this ->pass ->getContainerBuilder ();
115117 $ definitions = [];
116118
119+ /** @var array{name: string}|string $tagValue */
117120 foreach ($ builder ->findByTag ($ tag ) as $ serviceName => $ tagValue ) {
118- $ definitions [(string ) $ tagValue ] = $ serviceName ;
121+ $ name = is_array ($ tagValue ) ? $ tagValue ['name ' ] : $ tagValue ;
122+ $ definitions [$ name ] = $ serviceName ;
119123 }
120124
121125 return $ definitions ;
Original file line number Diff line number Diff line change 2222 * @property-read stdClass $config
2323 * @phpstan-type TManagerConfig object{
2424 * entityManagerDecoratorClass: string|null,
25- * configurationClass: string,
25+ * configurationClass: class- string,
2626 * lazyNativeObjects: bool|null,
2727 * proxyDir: string|null,
2828 * autoGenerateProxyClasses: int|bool|Statement,
@@ -86,7 +86,7 @@ public function __construct(
8686 public function getConfigSchema (): Schema
8787 {
8888 $ parameters = $ this ->getContainerBuilder ()->parameters ;
89- $ proxyDir = isset ($ parameters ['tempDir ' ]) ? $ parameters ['tempDir ' ] . '/cache/doctrine/orm/proxies ' : null ;
89+ $ proxyDir = isset ($ parameters ['tempDir ' ]) && is_string ( $ parameters [ ' tempDir ' ]) ? $ parameters ['tempDir ' ] . '/cache/doctrine/orm/proxies ' : null ;
9090 $ autoGenerateProxy = boolval ($ parameters ['debugMode ' ] ?? true );
9191
9292 $ expectService = Expect::anyOf (
Original file line number Diff line number Diff line change 1- <?php declare (strict_types= 1 );
1+ <?php declare (strict_types = 1 );
22
33use Contributte \Tester \Toolkit ;
44use Contributte \Tester \Utils \ContainerBuilder ;
You can’t perform that action at this time.
0 commit comments