@@ -184,7 +184,8 @@ public function getByType(string $type, bool $throw = false): ?string
184184 {
185185 $ type = Helpers::normalizeClass ($ type );
186186
187- if ($ this ->currentService !== null
187+ if (
188+ $ this ->currentService !== null
188189 && is_a ($ this ->definitions [$ this ->currentService ]->getType (), $ type , true )
189190 ) {
190191 return $ this ->currentService ;
@@ -300,7 +301,8 @@ public function prepareClassList(): void
300301 }
301302
302303 // auto-disable autowiring for aliases
303- if ($ def ->getAutowired () === true
304+ if (
305+ $ def ->getAutowired () === true
304306 && ($ alias = $ this ->getServiceName ($ def ->getFactory ()->getEntity ()))
305307 && (!$ def ->getImplement () || (!Strings::contains ($ alias , '\\' ) && $ this ->definitions [$ alias ]->getImplement ()))
306308 ) {
@@ -401,7 +403,8 @@ private function resolveImplement(ServiceDefinition $def, $name): void
401403 if (!$ def ->getEntity ()) {
402404 $ def ->setFactory ($ def ->getType (), $ def ->getFactory () ? $ def ->getFactory ()->arguments : []);
403405 }
404- if (($ class = $ this ->resolveEntityType ($ def ->getFactory (), [$ name => 1 ]))
406+ if (
407+ ($ class = $ this ->resolveEntityType ($ def ->getFactory (), [$ name => 1 ]))
405408 && ($ ctor = (new ReflectionClass ($ class ))->getConstructor ())
406409 ) {
407410 foreach ($ ctor ->getParameters () as $ param ) {
@@ -613,9 +616,10 @@ public function completeStatement(Statement $statement): Statement
613616 if (!$ arguments && substr ($ entity [1 ], -2 ) === '[] ' ) {
614617 throw new ServiceCreationException ("Missing argument for $ entity [1 ]. " );
615618 }
616- } elseif ($ type = empty ($ service ) || $ entity [1 ] === 'create '
617- ? $ this ->resolveEntityType ($ entity [0 ])
618- : $ this ->definitions [$ service ]->getType ()
619+ } elseif (
620+ $ type = empty ($ service ) || $ entity [1 ] === 'create '
621+ ? $ this ->resolveEntityType ($ entity [0 ])
622+ : $ this ->definitions [$ service ]->getType ()
619623 ) {
620624 $ arguments = $ this ->autowireArguments ($ type , $ entity [1 ], $ arguments );
621625 }
0 commit comments