REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.76 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/vendor/rector/rector-symfony/src/Annotation/AnnotationAnalyzer.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\Symfony\Annotation; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory; use Rector\Symfony\Enum\SymfonyAnnotation; final class AnnotationAnalyzer { /** * @readonly * @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory */ private $phpDocInfoFactory; public function __construct(PhpDocInfoFactory $phpDocInfoFactory) { $this->phpDocInfoFactory = $phpDocInfoFactory; } public function hasClassMethodWithTemplateAnnotation(Class_ $class) : bool { $classTemplateAnnotation = $this->getDoctrineAnnotationTagValueNode($class, SymfonyAnnotation::TEMPLATE); if ($classTemplateAnnotation instanceof DoctrineAnnotationTagValueNode) { return \true; } foreach ($class->getMethods() as $classMethod) { $classMethodTemplateAnnotation = $this->getDoctrineAnnotationTagValueNode($classMethod, SymfonyAnnotation::TEMPLATE); if ($classMethodTemplateAnnotation instanceof DoctrineAnnotationTagValueNode) { return \true; } } return \false; } /** * @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\ClassMethod $node */ public function getDoctrineAnnotationTagValueNode($node, string $annotationClass) : ?DoctrineAnnotationTagValueNode { $phpDocInfo = $this->phpDocInfoFactory->createFromNode($node); if (!$phpDocInfo instanceof PhpDocInfo) { return null; } return $phpDocInfo->getByAnnotationClass($annotationClass); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 1
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AnnotationAnalyzer.php
1.76 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).