REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 3.44 KB
Close
/opt/cpanel/ea-wappspector/vendor/rector/rector/vendor/rector/rector-doctrine/src/NodeAnalyzer/AttrinationFinder.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\Doctrine\NodeAnalyzer; use PhpParser\Node\Attribute; use PhpParser\Node\Param; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Property; use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory; /** * @api */ final class AttrinationFinder { /** * @readonly * @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory */ private $phpDocInfoFactory; /** * @readonly * @var \Rector\Doctrine\NodeAnalyzer\AttributeFinder */ private $attributeFinder; public function __construct(PhpDocInfoFactory $phpDocInfoFactory, \Rector\Doctrine\NodeAnalyzer\AttributeFinder $attributeFinder) { $this->phpDocInfoFactory = $phpDocInfoFactory; $this->attributeFinder = $attributeFinder; } /** * @param \PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Param $node * @return \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode|\PhpParser\Node\Attribute|null */ public function getByOne($node, string $name) { $phpDocInfo = $this->phpDocInfoFactory->createFromNode($node); if ($phpDocInfo instanceof PhpDocInfo && $phpDocInfo->hasByAnnotationClass($name)) { return $phpDocInfo->getByAnnotationClass($name); } return $this->attributeFinder->findAttributeByClass($node, $name); } /** * @param \PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Param $node */ public function hasByOne($node, string $name) : bool { $phpDocInfo = $this->phpDocInfoFactory->createFromNode($node); if ($phpDocInfo instanceof PhpDocInfo && $phpDocInfo->hasByAnnotationClass($name)) { return \true; } $attribute = $this->attributeFinder->findAttributeByClass($node, $name); return $attribute instanceof Attribute; } /** * @param string[] $classNames * @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Property $property */ public function hasByMany($property, array $classNames) : bool { $phpDocInfo = $this->phpDocInfoFactory->createFromNode($property); if ($phpDocInfo instanceof PhpDocInfo && $phpDocInfo->hasByAnnotationClasses($classNames)) { return \true; } $attribute = $this->attributeFinder->findAttributeByClasses($property, $classNames); return $attribute instanceof Attribute; } /** * @param string[] $classNames * @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Property $property * @return \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode|\PhpParser\Node\Attribute|null */ public function getByMany($property, array $classNames) { $phpDocInfo = $this->phpDocInfoFactory->createFromNode($property); if ($phpDocInfo instanceof PhpDocInfo) { $foundDoctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClasses($classNames); if ($foundDoctrineAnnotationTagValueNode instanceof DoctrineAnnotationTagValueNode) { return $foundDoctrineAnnotationTagValueNode; } } return $this->attributeFinder->findAttributeByClasses($property, $classNames); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AttributeFinder.php
4.39 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
AttrinationFinder.php
3.44 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ConstructorAssignPropertyAnalyzer.php
1.82 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DoctrineEntityDetector.php
1.28 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MethodUniqueReturnedPropertyResolver.php
1.38 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TargetEntityResolver.php
2.15 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).