Find the best Rector rule to solve your problem
Removes defined arguments in defined methods and their calls.
$someObject = new SomeClass;
-$someObject->someMethod(true);
+$someObject->someMethod();
Change $container->get("some_name") to bare type, useful since Symfony 3.4
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
public function run()
{
$container = $this->getContainer();
- $someClass = $container->get('some_name');
+ $someClass = $container->get(SomeType::class);
}
}
Merge removed @Method annotation to @Route one
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends Controller
{
/**
- * @Route("/show/{id}")
- * @Method({"GET", "HEAD"})
+ * @Route("/show/{id}", methods={"GET","HEAD"})
*/
public function show($id)
{
}
}
Replace Sensio @Route annotation with Symfony one
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+use Symfony\Component\Routing\Annotation\Route;
final class SomeClass
{
/**
* @Route()
*/
public function run()
{
}
}
Remove service from Sensio @Route
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
final class SomeClass
{
/**
- * @Route(service="some_service")
+ * @Route()
*/
public function run()
{
}
}