function AutowireRequiredMethodsPass::isWither
1 call to AutowireRequiredMethodsPass::isWither()
- AutowireRequiredMethodsPass::processValue in vendor/
symfony/ dependency-injection/ Compiler/ AutowireRequiredMethodsPass.php - Processes a value found in a definition tree.
File
-
vendor/
symfony/ dependency-injection/ Compiler/ AutowireRequiredMethodsPass.php, line 80
Class
- AutowireRequiredMethodsPass
- Looks for definitions with autowiring enabled and registers their corresponding "#[Required]" methods as setters.
Namespace
Symfony\Component\DependencyInjection\CompilerCode
private function isWither(\ReflectionMethod $reflectionMethod, string $doc) : bool {
$match = preg_match('#(?:^/\\*\\*|\\n\\s*+\\*)\\s*+@return\\s++(static|\\$this)[\\s\\*]#i', $doc, $matches);
if ($match && 'static' === $matches[1]) {
return true;
}
if ($match && '$this' === $matches[1]) {
return false;
}
$reflectionType = $reflectionMethod->hasReturnType() ? $reflectionMethod->getReturnType() : null;
return $reflectionType instanceof \ReflectionNamedType && 'static' === $reflectionType->getName();
}