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

Found 8 rules:

ArrayKeyExistsNullToEmptyStringRector

Replace null key in array_key_exists with empty string

-array_key_exists(null, $array);
+array_key_exists('', $array);
SETS:  PHP 8.5

ChrArgModuloRector

Wrap chr() argument with % 256 to avoid deprecated out-of-range integers

-echo chr(300);
+echo chr(300 % 256);
SETS:  PHP 8.5

RemoveFinfoBufferContextArgRector

Remove argument by position by function name

-finfo_buffer($finfo, $fileContents, FILEINFO_NONE, []);
+finfo_buffer($finfo, $fileContents, FILEINFO_NONE);
SETS:  PHP 8.5

OrdSingleByteRector

Replace ord($str) with ord($str[0])

-echo ord('abc');
+echo ord('a');
SETS:  PHP 8.5

ColonAfterSwitchCaseRector

Change deprecated semicolon to colon after switch case

 switch ($value) {
-    case 'baz';
+    case 'baz':
         echo 'baz';
 }
SETS:  PHP 8.5

DeprecatedAnnotationToDeprecatedAttributeRector

Change @deprecated annotation to Deprecated attribute

-/**
- * @deprecated 1.0.0 Use SomeOtherConstant instead
- */
+#[\Deprecated(message: 'Use SomeOtherConstant instead', since: '1.0.0')]
 const SomeConstant = 'irrelevant';
SETS:  PHP 8.5

NullDebugInfoReturnRector

Replaces null return value with empty array in __debugInfo methods

 new class
 {
     public function __debugInfo() {
-        return null;
+        return [];
     }
 };
SETS:  PHP 8.5

ArrayFirstLastRector

Make use of array_first() and array_last()

-echo $array[array_key_first($array)];
-echo $array[array_key_last($array)];
+echo array_first($array);
+echo array_last($array;
SETS:  PHP 8.5