REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.46 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/vendor/rector/rector-doctrine/src/NodeManipulator/ConstructorManipulator.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\Doctrine\NodeManipulator; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Expression; use Rector\NodeManipulator\ClassInsertManipulator; use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\PhpParser\Node\NodeFactory; use Rector\ValueObject\MethodName; final class ConstructorManipulator { /** * @readonly * @var \Rector\PhpParser\Node\NodeFactory */ private $nodeFactory; /** * @readonly * @var \Rector\NodeManipulator\ClassInsertManipulator */ private $classInsertManipulator; public function __construct(NodeFactory $nodeFactory, ClassInsertManipulator $classInsertManipulator) { $this->nodeFactory = $nodeFactory; $this->classInsertManipulator = $classInsertManipulator; } public function addStmtToConstructor(Class_ $class, Expression $newExpression) : void { $constructClassMethod = $class->getMethod(MethodName::CONSTRUCT); if ($constructClassMethod instanceof ClassMethod) { $constructClassMethod->stmts[] = $newExpression; } else { $constructClassMethod = $this->nodeFactory->createPublicMethod(MethodName::CONSTRUCT); $constructClassMethod->stmts[] = $newExpression; $this->classInsertManipulator->addAsFirstMethod($class, $constructClassMethod); $class->setAttribute(AttributeKey::ORIGINAL_NODE, null); } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ColumnPropertyTypeResolver.php
5.30 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
ConstructorManipulator.php
1.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
NullabilityColumnPropertyTypeResolver.php
2.50 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
ToManyRelationPropertyTypeResolver.php
4.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
ToOneRelationPropertyTypeResolver.php
6.56 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).