Try Rector
Documentation
Hire Team
Blog
Contact
Try Rector
Documentation
Hire Team
Blog
Contact
Rector run Failed:
{ "totals": { "changed_files": 0, "errors": 1 }, "errors": [ { "message": "System error: \"Scope not available on \"PhpParser\\Node\\Expr\\MethodCall\" node. Fix scope refresh on changed nodes first\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/storage/demo/f9c4akmw9cljwk5cbfwq/rector_analyzed_file.php", "line": 19 } ] }
Run Rector on your code to see what it can do for you:
PHP snippet to change
<?php namespace App\Controller; class SuggestionController { private function handlePlugin(Request $request) { { $form = $this->createForm(ArticleFormType::class, $article); return $this->render('Article/edit.html.twig', [ 'media' => $media, 'form' => $form->createView(), 'headline' => $headline, 'article' => $article ]); $form = $this->createForm(HeadlineType::class, $headline); return $this->render('headline/new.html.twig', [ 'headline' => $headline, 'media' => $media, 'form' => $form->createView(), ]); } } }
Config
rector.php
<?php declare(strict_types=1); use Rector\Config\RectorConfig; use PHPStan\Type\ArrayType; use PHPStan\Type\MixedType; use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector; use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration; return RectorConfig::configure() // uncomment to reach your current PHP version ->withPhpVersion(Rector\ValueObject\PhpVersion::PHP_84) ->withRules([ Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector::class, ]) ->withConfiguredRule(AddReturnTypeDeclarationRector::class, [ new AddReturnTypeDeclaration('SomeClass', 'getData', new ArrayType(new MixedType(), new MixedType())), ]) ->withPhpSets(php84: true) ->withTypeCoverageLevel(10) ->withDeadCodeLevel(0) ->withCodeQualityLevel(0);
Run Rector
Rector version:
5fea92
- released at 2026-08-24 13:03