Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,27 @@ Convert migrations to anonymous classes.

<br>

## AssertStatusToAssertMethodRector

Change `assertStatus($statusCode)` to the equivalent method `assertOk()` for example.

- class: [`RectorLaravel\Rector\MethodCall\AssertStatusToAssertMethodRector`](../src/Rector/MethodCall/AssertStatusToAssertMethodRector.php)

```diff
use Illuminate\Foundation\Testing\TestCase;

final class SomeTest extends TestCase
{
public function test(): void
{
- $this->get('/')->assertStatus(200);
+ $this->get('/')->assertOk();
}
}
```

<br>

## CallOnAppArrayAccessToStandaloneAssignRector

Replace magical call on `$this->app["something"]` to standalone type assign variable
Expand Down Expand Up @@ -247,6 +268,21 @@ Convert DB Expression `__toString()` calls to `getValue()` method calls.

<br>

## EmptyToBlankAndFilledFuncRector

Convert `empty()` calls to `blank()` and `!empty()` calls to `filled()`.

- class: [`RectorLaravel\Rector\FuncCall\EmptyToBlankAndFilledFuncRector`](../src/Rector/FuncCall/EmptyToBlankAndFilledFuncRector.php)

```diff
-$empty = empty($value);
+$empty = blank($value);
-$notEmpty = !empty($value);
+$notEmpty = filled($value);
```

<br>

## FactoryApplyingStatesRector

Call the state methods directly instead of specify the name of state.
Expand Down