AddRequireTldToUrlConstraintRector
Add explicit "requireTld: false" to the Url constraint, to keep the current behavior once the default changes to true
use Symfony\Component\Validator\Constraints\Url;
-$constraint = new Url(message: 'Invalid URL');
+$constraint = new Url(message: 'Invalid URL', requireTld: false);
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony80\Rector\New_\AddRequireTldToUrlConstraintRector;
return RectorConfig::configure()
->withRules([
AddRequireTldToUrlConstraintRector::class,
]);
PACKAGE:
symfony/validator >=7.1