phpDocInfoFactory = $phpDocInfoFactory; $this->phpAttributeAnalyzer = $phpAttributeAnalyzer; } /** * @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Param|\PhpParser\Node\Stmt\Property $node */ public function detect($node) : bool { $nodePhpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); if ($nodePhpDocInfo->hasByNames(['required', 'inject'])) { return \true; } return $this->phpAttributeAnalyzer->hasPhpAttributes($node, ['Symfony\\Contracts\\Service\\Attribute\\Required', 'Nette\\DI\\Attributes\\Inject']); } }