FormIsValidRector

Adds $form->isSubmitted() validation to all $form->isValid() calls in Form in Symfony

-if ($form->isValid()) {
+if ($form->isSubmitted() && $form->isValid()) {
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony40\Rector\MethodCall\FormIsValidRector;

return RectorConfig::configure()
    ->withRules([
        FormIsValidRector::class,
    ]);
SETS:  symfony/* 4.0