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