Find the best Rector rule to solve your problem
Replaces defined classes by new ones.
namespace App;
-use SomeOldClass;
+use SomeNewClass;
-function someFunction(SomeOldClass $someOldClass): SomeOldClass
+function someFunction(SomeNewClass $someOldClass): SomeNewClass
{
- if ($someOldClass instanceof SomeOldClass) {
- return new SomeOldClass;
+ if ($someOldClass instanceof SomeNewClass) {
+ return new SomeNewClass;
}
}
Adds a new $filter
argument in VarDumperTestTrait->assertDumpEquals()
and VarDumperTestTrait->assertDumpMatchesFormat()
in Validator in Symfony.
-$varDumperTestTrait->assertDumpEquals($dump, $data, $message = "");
+$varDumperTestTrait->assertDumpEquals($dump, $data, $filter = 0, $message = "");
Adds $form->isSubmitted()
validation to all $form->isValid()
calls in Form in Symfony
-if ($form->isValid()) {
+if ($form->isSubmitted() && $form->isValid()) {
}
Turns old default value to parameter in ContainerBuilder->build() method in DI in Symfony
use Symfony\Component\DependencyInjection\ContainerBuilder;
$containerBuilder = new ContainerBuilder();
-$containerBuilder->compile();
+$containerBuilder->compile(true);
Turns true value to Url::CHECK_DNS_TYPE_ANY
in Validator in Symfony.
-$constraint = new Url(["checkDNS" => true]);
+$constraint = new Url(["checkDNS" => Url::CHECK_DNS_TYPE_ANY]);