REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.85 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/src/NodeManipulator/ClassMethodAssignManipulator.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\NodeManipulator; use PhpParser\Node\Expr\Assign; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Expression; use PHPStan\Type\Type; use Rector\NodeNameResolver\NodeNameResolver; use Rector\PhpParser\Node\NodeFactory; final class ClassMethodAssignManipulator { /** * @readonly * @var \Rector\PhpParser\Node\NodeFactory */ private $nodeFactory; /** * @readonly * @var \Rector\NodeNameResolver\NodeNameResolver */ private $nodeNameResolver; /** * @var array<int, string[]> */ private $alreadyAddedClassMethodNames = []; public function __construct(NodeFactory $nodeFactory, NodeNameResolver $nodeNameResolver) { $this->nodeFactory = $nodeFactory; $this->nodeNameResolver = $nodeNameResolver; } public function addParameterAndAssignToMethod(ClassMethod $classMethod, string $name, ?Type $type, Assign $assign) : void { if ($this->hasMethodParameter($classMethod, $name)) { return; } $classMethod->params[] = $this->nodeFactory->createParamFromNameAndType($name, $type); $classMethod->stmts[] = new Expression($assign); $classMethodId = \spl_object_id($classMethod); $this->alreadyAddedClassMethodNames[$classMethodId][] = $name; } private function hasMethodParameter(ClassMethod $classMethod, string $name) : bool { foreach ($classMethod->params as $param) { if ($this->nodeNameResolver->isName($param->var, $name)) { return \true; } } $classMethodId = \spl_object_id($classMethod); if (!isset($this->alreadyAddedClassMethodNames[$classMethodId])) { return \false; } return \in_array($name, $this->alreadyAddedClassMethodNames[$classMethodId], \true); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 15
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AssignManipulator.php
2.92 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
BinaryOpManipulator.php
4.83 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
ClassConstManipulator.php
2.61 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
ClassDependencyManipulator.php
9.08 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
ClassInsertManipulator.php
2.61 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
ClassManipulator.php
1.79 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
ClassMethodAssignManipulator.php
1.85 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
ClassMethodManipulator.php
2.18 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
ClassMethodPropertyFetchManipulator.php
4.25 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
FuncCallManipulator.php
1.08 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
FunctionLikeManipulator.php
755 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
IfManipulator.php
6.19 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
PropertyFetchAssignManipulator.php
2.46 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
PropertyManipulator.php
8.65 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
StmtsManipulator.php
3.08 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).