8000 bug #18596 [DI] Fix internal caching in AutowirePass (nicolas-grekas) · symfony/symfony@d1038c3 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d1038c3

Browse files
bug #18596 [DI] Fix internal caching in AutowirePass (nicolas-grekas)
This PR was merged into the 2.8 branch. Discussion ---------- [DI] Fix internal caching in AutowirePass | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - ping @dunglas Commits ------- ed2e236 [DI] Fix internal caching in AutowirePass
2 parents 44e3664 + ed2e236 commit d1038c3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ private function createAutowiredDefinition(\ReflectionClass $typeHint, $id)
228228
* @param string $id
229229
* @param Definition $definition
230230
*
231-
* @return \ReflectionClass|null
231+
* @return \ReflectionClass|false
232232
*/
233233
private function getReflectionClass($id, Definition $definition)
234234
{
@@ -238,15 +238,17 @@ private function getReflectionClass($id, Definition $definition)
238238

239239
// Cannot use reflection if the class isn't set
240240
if (!$class = $definition->getClass()) {
241-
return;
241+
return false;
242242
}
243243

244244
$class = $this->container->getParameterBag()->resolveValue($class);
245245

246246
try {
247-
return $this->reflectionClasses[$id] = new \ReflectionClass($class);
247+
$reflector = new \ReflectionClass($class);
248248
} catch (\ReflectionException $reflectionException) {
249-
// return null
249+
$reflector = false;
250250
}
251+
252+
return $this->reflectionClasses[$id] = $reflector;
251253
}
252254
}

0 commit comments

Comments
 (0)
0