Skip to content

Commit 2f56b55

Browse files
authored
Adds docs for missing rules (#111)
1 parent b3fb8f3 commit 2f56b55

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/rector_rules_overview.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,27 @@ Convert migrations to anonymous classes.
168168

169169
<br>
170170

171+
## AssertStatusToAssertMethodRector
172+
173+
Change `assertStatus($statusCode)` to the equivalent method `assertOk()` for example.
174+
175+
- class: [`RectorLaravel\Rector\MethodCall\AssertStatusToAssertMethodRector`](../src/Rector/MethodCall/AssertStatusToAssertMethodRector.php)
176+
177+
```diff
178+
use Illuminate\Foundation\Testing\TestCase;
179+
180+
final class SomeTest extends TestCase
181+
{
182+
public function test(): void
183+
{
184+
- $this->get('/')->assertStatus(200);
185+
+ $this->get('/')->assertOk();
186+
}
187+
}
188+
```
189+
190+
<br>
191+
171192
## CallOnAppArrayAccessToStandaloneAssignRector
172193

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

248269
<br>
249270

271+
## EmptyToBlankAndFilledFuncRector
272+
273+
Convert `empty()` calls to `blank()` and `!empty()` calls to `filled()`.
274+
275+
- class: [`RectorLaravel\Rector\FuncCall\EmptyToBlankAndFilledFuncRector`](../src/Rector/FuncCall/EmptyToBlankAndFilledFuncRector.php)
276+
277+
```diff
278+
-$empty = empty($value);
279+
+$empty = blank($value);
280+
-$notEmpty = !empty($value);
281+
+$notEmpty = filled($value);
282+
```
283+
284+
<br>
285+
250286
## FactoryApplyingStatesRector
251287

252288
Call the state methods directly instead of specify the name of state.

0 commit comments

Comments
 (0)