Replace "GET" string by Symfony Request object class constants
use Symfony\Component\Form\FormBuilderInterface;
final class SomeClass
{
public function detail(FormBuilderInterface $formBuilder)
{
- $formBuilder->setMethod('GET');
+ $formBuilder->setMethod(\Symfony\Component\HttpFoundation\Request::GET);
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstantRector;
return RectorConfig::configure()
->withRules([
LiteralGetToRequestClassConstantRector::class,
]);