REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.27 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/src/PostRector/Rector/DocblockNameImportingPostRector.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\PostRector\Rector; use PhpParser\Node; use PhpParser\Node\Param; use PhpParser\Node\Stmt; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory; use Rector\Comments\NodeDocBlock\DocBlockUpdater; use Rector\NodeTypeResolver\PhpDoc\NodeAnalyzer\DocBlockNameImporter; use Rector\PostRector\Guard\AddUseStatementGuard; final class DocblockNameImportingPostRector extends \Rector\PostRector\Rector\AbstractPostRector { /** * @readonly * @var \Rector\NodeTypeResolver\PhpDoc\NodeAnalyzer\DocBlockNameImporter */ private $docBlockNameImporter; /** * @readonly * @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory */ private $phpDocInfoFactory; /** * @readonly * @var \Rector\Comments\NodeDocBlock\DocBlockUpdater */ private $docBlockUpdater; /** * @readonly * @var \Rector\PostRector\Guard\AddUseStatementGuard */ private $addUseStatementGuard; public function __construct(DocBlockNameImporter $docBlockNameImporter, PhpDocInfoFactory $phpDocInfoFactory, DocBlockUpdater $docBlockUpdater, AddUseStatementGuard $addUseStatementGuard) { $this->docBlockNameImporter = $docBlockNameImporter; $this->phpDocInfoFactory = $phpDocInfoFactory; $this->docBlockUpdater = $docBlockUpdater; $this->addUseStatementGuard = $addUseStatementGuard; } /** * @return \PhpParser\Node|int|null */ public function enterNode(Node $node) { if (!$node instanceof Stmt && !$node instanceof Param) { return null; } $phpDocInfo = $this->phpDocInfoFactory->createFromNode($node); if (!$phpDocInfo instanceof PhpDocInfo) { return null; } $hasDocChanged = $this->docBlockNameImporter->importNames($phpDocInfo->getPhpDocNode(), $node); if (!$hasDocChanged) { return null; } $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node); return $node; } /** * @param Stmt[] $stmts */ public function shouldTraverse(array $stmts) : bool { return $this->addUseStatementGuard->shouldTraverse($stmts, $this->getFile()->getFilePath()); } }
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
AbstractPostRector.php
826 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ClassRenamingPostRector.php
4.37 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
DocblockNameImportingPostRector.php
2.27 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
NameImportingPostRector.php
1.81 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
UnusedImportRemovingPostRector.php
7.77 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
UseAddingPostRector.php
5.36 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).