Find the best Rector rule to solve your problem. Searching through 637 rules.

Found 4 rules:

CombineHostPortLdapUriRector

Combine separated host and port on ldap_connect() args

-ldap_connect('ldap://ldap.example.com', 389);
+ldap_connect('ldap://ldap.example.com:389');
SETS:  PHP 8.3

RemoveGetClassGetParentClassNoArgsRector

Replace calls to get_class() and get_parent_class() without arguments with self::class and parent::class.

 class Example extends StdClass {
     public function whoAreYou() {
-        return get_class() . ' daughter of ' . get_parent_class();
+        return self::class . ' daughter of ' . parent::class;
     }
 }
SETS:  PHP 8.3

AddTypeToConstRector

Add type to constants based on their value

 final class SomeClass
 {
-    public const TYPE = 'some_type';
+    public const string TYPE = 'some_type';
 }
SETS:  PHP 8.3

AddOverrideAttributeToOverriddenMethodsRector

Add override attribute to overridden methods

 class ParentClass
 {
     public function foo()
     {
         echo 'default';
     }
 }

 final class ChildClass extends ParentClass
 {
+    #[\Override]
     public function foo()
     {
         echo 'override default';
     }
 }
SETS:  PHP 8.3