Updated Rector to commit 26720daf6497fe2d563d88d670ee5a6af944250c

26720daf64 rebuild docs
This commit is contained in:
Tomas Votruba 2024-06-24 12:58:49 +00:00
parent 74f377df65
commit 571bddfb01
2 changed files with 46 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# 379 Rules Overview # 381 Rules Overview
<br> <br>
@ -8,7 +8,7 @@
- [Carbon](#carbon) (4) - [Carbon](#carbon) (4)
- [CodeQuality](#codequality) (73) - [CodeQuality](#codequality) (75)
- [CodingStyle](#codingstyle) (28) - [CodingStyle](#codingstyle) (28)
@ -364,6 +364,35 @@ Refactor `call_user_func()` with arrow function to direct call
<br> <br>
### CallableThisArrayToAnonymousFunctionRector
Convert [$this, "method"] to proper anonymous function
- class: [`Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector`](../rules/CodeQuality/Rector/Array_/CallableThisArrayToAnonymousFunctionRector.php)
```diff
class SomeClass
{
public function run()
{
$values = [1, 5, 3];
- usort($values, [$this, 'compareSize']);
+ usort($values, function ($first, $second) {
+ return $this->compareSize($first, $second);
+ });
return $values;
}
private function compareSize($first, $second)
{
return $first <=> $second;
}
}
```
<br>
### ChangeArrayPushToArrayAssignRector ### ChangeArrayPushToArrayAssignRector
Change `array_push()` to direct variable assign Change `array_push()` to direct variable assign
@ -723,6 +752,19 @@ Simplify `foreach` loops into `in_array` when possible
<br> <br>
### GetClassToInstanceOfRector
Changes comparison with get_class to instanceof
- class: [`Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector`](../rules/CodeQuality/Rector/Identical/GetClassToInstanceOfRector.php)
```diff
-if (EventsListener::class === get_class($event->job)) { }
+if ($event->job instanceof EventsListener) { }
```
<br>
### InlineArrayReturnAssignRector ### InlineArrayReturnAssignRector
Inline just in time array dim fetch assigns to direct return Inline just in time array dim fetch assigns to direct return

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = '8aad07fe1585659eed842b924e0a7ddb6c43d8e2'; public const PACKAGE_VERSION = '26720daf6497fe2d563d88d670ee5a6af944250c';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2024-06-24 19:16:17'; public const RELEASE_DATE = '2024-06-24 21:56:06';
/** /**
* @var int * @var int
*/ */