PATH:
opt
/
cpanel
/
ea-wappspector
/
vendor
/
rector
/
rector
/
rules
/
TypeDeclaration
/
NodeAnalyzer
<?php declare (strict_types=1); namespace Rector\TypeDeclaration\NodeAnalyzer; use PhpParser\Node\Param; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Property; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory; use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer; final class AutowiredClassMethodOrPropertyAnalyzer { /** * @readonly * @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory */ private $phpDocInfoFactory; /** * @readonly * @var \Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer */ private $phpAttributeAnalyzer; public function __construct(PhpDocInfoFactory $phpDocInfoFactory, PhpAttributeAnalyzer $phpAttributeAnalyzer) { $this->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']); } }
[-] DeclareStrictTypeFinder.php
[edit]
[+]
..
[+]
ReturnTypeAnalyzer
[-] TypeNodeUnwrapper.php
[edit]
[-] NeverFuncCallAnalyzer.php
[edit]
[-] ParamAnalyzer.php
[edit]
[-] ReturnAnalyzer.php
[edit]
[-] AutowiredClassMethodOrPropertyAnalyzer.php
[edit]
[-] ClassMethodParamTypeCompleter.php
[edit]
[-] ClassMethodAndPropertyAnalyzer.php
[edit]
[+]
ReturnFilter
[-] CallTypesResolver.php
[edit]
[-] CallerParamMatcher.php
[edit]