Skip to content

Commit

Permalink
Updated Rector to commit cc15e20e1f0e01799b3ca4997305a7adda22654c
Browse files Browse the repository at this point in the history
rectorphp/rector-src@cc15e20 [automated] Re-Generate Nodes/Rectors Documentation (#6010)
  • Loading branch information
TomasVotruba committed Jun 23, 2024
1 parent ec03eec commit 0ed3e26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 46 deletions.
46 changes: 2 additions & 44 deletions docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 381 Rules Overview
# 379 Rules Overview

<br>

Expand All @@ -8,7 +8,7 @@

- [Carbon](#carbon) (4)

- [CodeQuality](#codequality) (75)
- [CodeQuality](#codequality) (73)

- [CodingStyle](#codingstyle) (28)

Expand Down Expand Up @@ -364,35 +364,6 @@ 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
Expand Down Expand Up @@ -752,19 +723,6 @@ 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
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '41eac561ccc1416f1fd1882473daa54a3c9f8603';
public const PACKAGE_VERSION = 'cc15e20e1f0e01799b3ca4997305a7adda22654c';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-06-23 01:34:47';
public const RELEASE_DATE = '2024-06-23 00:28:30';
/**
* @var int
*/
Expand Down

0 comments on commit 0ed3e26

Please sign in to comment.