opt
/
cpanel
/
ea-wappspector
/
vendor
/
rector
/
rector
/
vendor
/
rector
/
rector-doctrine
/
src
/
NodeFactory
➕ New
📤 Upload
✎ Editing:
ArrayCollectionAssignFactory.php
← Back
<?php declare (strict_types=1); namespace Rector\Doctrine\NodeFactory; use PhpParser\Node\Expr\Assign; use PhpParser\Node\Expr\New_; use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Stmt\Expression; use Rector\PhpParser\Node\NodeFactory; final class ArrayCollectionAssignFactory { /** * @readonly * @var \Rector\PhpParser\Node\NodeFactory */ private $nodeFactory; public function __construct(NodeFactory $nodeFactory) { $this->nodeFactory = $nodeFactory; } public function createFromPropertyName(string $toManyPropertyName) : Expression { $propertyFetch = $this->nodeFactory->createPropertyFetch('this', $toManyPropertyName); $new = new New_(new FullyQualified('Doctrine\\Common\\Collections\\ArrayCollection')); $assign = new Assign($propertyFetch, $new); return new Expression($assign); } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel