mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-28 15:00:50 +00:00
update docs
This commit is contained in:
parent
a5af2a7f3f
commit
88d3111975
|
@ -1,4 +1,4 @@
|
|||
# All 411 Rectors Overview
|
||||
# All 414 Rectors Overview
|
||||
|
||||
- [Projects](#projects)
|
||||
- [General](#general)
|
||||
|
@ -310,6 +310,27 @@ Changes settype() to (type) where possible
|
|||
|
||||
## CodeQuality
|
||||
|
||||
### `AbsolutizeRequireAndIncludePathRector`
|
||||
|
||||
- class: `Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector`
|
||||
|
||||
include/require to absolute path. This Rector might introduce backwards incompatible code, when the include/require beeing changed depends on the current working directory.
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
- require 'autoload.php';
|
||||
+ require __DIR__ . '/autoload.php';
|
||||
|
||||
require $variable;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### `AddPregQuoteDelimiterRector`
|
||||
|
||||
- class: `Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector`
|
||||
|
@ -344,6 +365,25 @@ Split 2 assigns ands to separate line
|
|||
|
||||
<br>
|
||||
|
||||
### `ArrayKeyExistsTernaryThenValueToCoalescingRector`
|
||||
|
||||
- class: `Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector`
|
||||
|
||||
Change array_key_exists() ternary to coalesing
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run($values, $keyToMatch)
|
||||
{
|
||||
- $result = array_key_exists($keyToMatch, $values) ? $values[$keyToMatch] : null;
|
||||
+ $result = $values[$keyToMatch] ?? null;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### `ArrayMergeOfNonArraysToSimpleArrayRector`
|
||||
|
||||
- class: `Rector\CodeQuality\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector`
|
||||
|
@ -1646,7 +1686,7 @@ Makes array_search search for identical elements
|
|||
|
||||
- class: `Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector`
|
||||
|
||||
Prefer quote that not inside the string
|
||||
Prefer quote that are not inside the string
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
|
@ -5879,9 +5919,9 @@ Changes property `@var` annotations from annotation to type.
|
|||
```diff
|
||||
final class SomeClass
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
- /**
|
||||
- * @var int
|
||||
- */
|
||||
- private count;
|
||||
+ private int count;
|
||||
}
|
||||
|
@ -6722,6 +6762,30 @@ Finalize every class constant that is used only locally
|
|||
|
||||
<br>
|
||||
|
||||
### `RemoveAlwaysElseRector`
|
||||
|
||||
- class: `Rector\SOLID\Rector\If_\RemoveAlwaysElseRector`
|
||||
|
||||
Remove if for last else, if previous values were throw
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run($value)
|
||||
{
|
||||
if ($value) {
|
||||
throw new \InvalidStateException;
|
||||
- } else {
|
||||
- return 10;
|
||||
}
|
||||
+
|
||||
+ return 10;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### `UseInterfaceOverImplementationInConstructorRector`
|
||||
|
||||
- class: `Rector\SOLID\Rector\ClassMethod\UseInterfaceOverImplementationInConstructorRector`
|
||||
|
|
Loading…
Reference in New Issue
Block a user