mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
Updated Rector to commit 26720daf6497fe2d563d88d670ee5a6af944250c
26720daf64
rebuild docs
This commit is contained in:
parent
74f377df65
commit
571bddfb01
@ -1,4 +1,4 @@
|
||||
# 379 Rules Overview
|
||||
# 381 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
- [Carbon](#carbon) (4)
|
||||
|
||||
- [CodeQuality](#codequality) (73)
|
||||
- [CodeQuality](#codequality) (75)
|
||||
|
||||
- [CodingStyle](#codingstyle) (28)
|
||||
|
||||
@ -364,6 +364,35 @@ Refactor `call_user_func()` with arrow function to direct call
|
||||
|
||||
<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
|
||||
|
||||
Change `array_push()` to direct variable assign
|
||||
@ -723,6 +752,19 @@ Simplify `foreach` loops into `in_array` when possible
|
||||
|
||||
<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
|
||||
|
||||
Inline just in time array dim fetch assigns to direct return
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '8aad07fe1585659eed842b924e0a7ddb6c43d8e2';
|
||||
public const PACKAGE_VERSION = '26720daf6497fe2d563d88d670ee5a6af944250c';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-06-24 19:16:17';
|
||||
public const RELEASE_DATE = '2024-06-24 21:56:06';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user