@@ -318,7 +318,7 @@ private function getAutowiredReference(TypedReference $reference, $deprecationMe
318
318
}
319
319
320
320
if (!$ reference ->canBeAutoregistered () || isset ($ this ->types [$ type ]) || isset ($ this ->ambiguousServiceTypes [$ type ])) {
321
- return ;
321
+ return null ;
322
322
}
323
323
324
324
if (isset ($ this ->autowired [$ type ])) {
@@ -328,6 +328,8 @@ private function getAutowiredReference(TypedReference $reference, $deprecationMe
328
328
if (!$ this ->strictMode ) {
329
329
return $ this ->createAutowiredDefinition ($ type );
330
330
}
331
+
332
+ return null ;
331
333
}
332
334
333
335
/**
@@ -425,7 +427,7 @@ private function set($type, $id)
425
427
private function createAutowiredDefinition ($ type )
426
428
{
427
429
if (!($ typeHint = $ this ->container ->getReflectionClass ($ type , false )) || !$ typeHint ->isInstantiable ()) {
428
- return ;
430
+ return null ;
429
431
}
430
432
431
433
$ currentId = $ this ->currentId ;
@@ -445,7 +447,7 @@ private function createAutowiredDefinition($type)
445
447
$ this ->lastFailure = $ e ->getMessage ();
446
448
$ this ->container ->log ($ this , $ this ->lastFailure );
447
449
448
- return ;
450
+ return null ;
449
451
} finally {
450
452
$ this ->throwOnAutowiringException = $ originalThrowSetting ;
451
453
$ this ->currentId = $ currentId ;
@@ -518,7 +520,7 @@ private function createTypeAlternatives(TypedReference $reference)
518
520
} elseif ($ reference ->getRequiringClass () && !$ reference ->canBeAutoregistered () && !$ this ->strictMode ) {
519
521
return ' It cannot be auto-registered because it is from a different root namespace. ' ;
520
522
} else {
521
- return ;
523
+ return '' ;
522
524
}
523
525
524
526
return sprintf (' You should maybe alias this %s to %s. ' , class_exists ($ type , false ) ? 'class ' : 'interface ' , $ message );
@@ -572,5 +574,7 @@ private function getAliasesSuggestionForType($type, $extraContext = null)
572
574
if ($ aliases ) {
573
575
return sprintf ('Try changing the type-hint%s to "%s" instead. ' , $ extraContext , $ aliases [0 ]);
574
576
}
577
+
578
+ return null ;
575
579
}
576
580
}
0 commit comments