Skip to content

Instantly share code, notes, and snippets.

View Neirda24's full-sized avatar
🍺
🍺

Adrien Roches Neirda24

🍺
🍺
View GitHub Profile
@Neirda24
Neirda24 / src\Rector\AddFormInterfaceGenericToTwigComponentWithFormRector.php
Created April 24, 2025 12:24
Rector rule to add the `@return FormInterface<TData>` on twig component with form trait on method `instantiateForm`
<?php
declare(strict_types=1);
namespace Utils\Rector\Rector;
use PhpParser\Comment\Doc;
use PhpParser\Node;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\TraitUse;