Skip to content

Commit

Permalink
Add ClassOnThisVariableObjectRector to rules docs (#3096)
Browse files Browse the repository at this point in the history
  • Loading branch information
mttsch committed Nov 26, 2022
1 parent 9a93704 commit f37a6eb
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 401 Rules Overview
# 402 Rules Overview

<br>

Expand Down Expand Up @@ -44,7 +44,7 @@

- [Php74](#php74) (15)

- [Php80](#php80) (19)
- [Php80](#php80) (20)

- [Php81](#php81) (11)

Expand Down Expand Up @@ -5803,6 +5803,25 @@ Change get_class($object) to faster `$object::class`

<br>

### ClassOnThisVariableObjectRector

Change `$this::class` to static::class or self::class depends on class modifier

- class: [`Rector\Php80\Rector\ClassConstFetch\ClassOnThisVariableObjectRector`](../rules/Php80/Rector/ClassConstFetch/ClassOnThisVariableObjectRector.php)

```diff
class SomeClass
{
public function run()
{
- return $this::class;
+ return static::class;
}
}
```

<br>

### ClassPropertyAssignToConstructorPromotionRector

Change simple property init and assign to constructor promotion
Expand Down

0 comments on commit f37a6eb

Please sign in to comment.