I’d like to propose a new Rector rule (or at least start a discussion) to automatically replace certain string literal argument values with class constants.
Examples
Example 1: Symfony WebLink
-new Link('preload');
+new Link(Link::REL_PRELOAD);
Example 2: Symfony HttpFoundation Cookie
-return Cookie::create($name, $value, new DateTime('+1 month'), '/', null, true, false, false, 'strict');
+return Cookie::create($name, $value, new DateTime('+1 month'), '/', null, true, false, false, Cookie::SAMESITE_STRICT);
A recent Symfony commit that hints to use constants:
symfony/symfony-docs@abc8d69