Find the best Rector rule to solve your problem. Searching through 637 rules.
Found 4 rules:
Combine separated host and port on ldap_connect() args
-ldap_connect('ldap://ldap.example.com', 389);
+ldap_connect('ldap://ldap.example.com:389');
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;
}
}
Add type to constants based on their value
final class SomeClass
{
- public const TYPE = 'some_type';
+ public const string TYPE = 'some_type';
}
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';
}
}