mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-28 23:10:51 +00:00
update docs
This commit is contained in:
parent
f8a6028cbc
commit
9ab3186fcf
|
@ -47,6 +47,7 @@
|
|||
- [Php\BinaryOp](#phpbinaryop)
|
||||
- [Php\ClassConst](#phpclassconst)
|
||||
- [Php\ConstFetch](#phpconstfetch)
|
||||
- [Php\Double](#phpdouble)
|
||||
- [Php\Each](#phpeach)
|
||||
- [Php\FuncCall](#phpfunccall)
|
||||
- [Php\FunctionLike](#phpfunctionlike)
|
||||
|
@ -413,6 +414,33 @@ Shortens if return false/true to direct return
|
|||
|
||||
<br>
|
||||
|
||||
### `ConsecutiveNullCompareReturnsToNullCoalesceQueueRector`
|
||||
|
||||
- class: `Rector\CodeQuality\Rector\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector`
|
||||
|
||||
Change multiple null compares to ?? queue
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
- if (null !== $this->orderItem) {
|
||||
- return $this->orderItem;
|
||||
- }
|
||||
-
|
||||
- if (null !== $this->orderItemUnit) {
|
||||
- return $this->orderItemUnit;
|
||||
- }
|
||||
-
|
||||
- return null;
|
||||
+ return $this->orderItem ?? $this->orderItemUnit;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## CodeQuality\LogicalOr
|
||||
|
||||
### `LogicalOrToBooleanOrRector`
|
||||
|
@ -1540,6 +1568,20 @@ String cannot be turned into array by assignment anymore
|
|||
|
||||
<br>
|
||||
|
||||
### `NullCoalescingOperatorRector`
|
||||
|
||||
- class: `Rector\Php\Rector\Assign\NullCoalescingOperatorRector`
|
||||
|
||||
Use null coalescing operator ??=
|
||||
|
||||
```diff
|
||||
$array = [];
|
||||
-$array['user_id'] = $array['user_id'] ?? 'value';
|
||||
+$array['user_id'] ??= 'value';
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### `MysqlAssignToMysqliRector`
|
||||
|
||||
- class: `Rector\Php\Rector\Assign\MysqlAssignToMysqliRector`
|
||||
|
@ -1631,6 +1673,29 @@ Changes unquoted non-existing constants to strings
|
|||
|
||||
<br>
|
||||
|
||||
## Php\Double
|
||||
|
||||
### `RealToFloatTypeCastRector`
|
||||
|
||||
- class: `Rector\Php\Rector\Double\RealToFloatTypeCastRector`
|
||||
|
||||
Change deprecated (real) to (float)
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
- $number = (real) 5;
|
||||
+ $number = (float) 5;
|
||||
$number = (float) 5;
|
||||
$number = (double) 5;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## Php\Each
|
||||
|
||||
### `WhileEachToForeachRector`
|
||||
|
@ -1743,7 +1808,7 @@ Null is no more allowed in get_class()
|
|||
|
||||
- class: `Rector\Php\Rector\FuncCall\TrailingCommaArgumentsRector`
|
||||
|
||||
Adds trailing commas to function and methods calls
|
||||
Adds trailing commas to function and methods calls
|
||||
|
||||
```diff
|
||||
calling(
|
||||
|
@ -3494,6 +3559,29 @@ services:
|
|||
|
||||
## Interface_
|
||||
|
||||
### `RemoveInterfacesRector`
|
||||
|
||||
- class: `Rector\Rector\Interface_\RemoveInterfacesRector`
|
||||
|
||||
Removes interfaces usage from class.
|
||||
|
||||
```yaml
|
||||
services:
|
||||
Rector\Rector\Interface_\RemoveInterfacesRector:
|
||||
- SomeInterface
|
||||
```
|
||||
|
||||
↓
|
||||
|
||||
```diff
|
||||
-class SomeClass implements SomeInterface
|
||||
+class SomeClass
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### `MergeInterfacesRector`
|
||||
|
||||
- class: `Rector\Rector\Interface_\MergeInterfacesRector`
|
||||
|
|
Loading…
Reference in New Issue
Block a user