Skip to content

Commit ef1b3b2

Browse files
committed
docs: add @phpstan-var to stop rector to skip RemoveAlwaysTrueIfConditionRector
Without this doc type, Rector will refactor the following: 1) system/Router/AutoRouterImproved.php:294 ---------- begin diff ---------- @@ @@ // Update the positions. $this->methodPos = $this->paramPos; - if ($params === []) { - $this->paramPos = null; - } + $this->paramPos = null; if ($this->paramPos !== null) { $this->paramPos++; } ----------- end diff ----------- Applied rules: * RemoveAlwaysTrueIfConditionRector
1 parent 49c4772 commit ef1b3b2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎system/Router/AutoRouterImproved.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ final class AutoRouterImproved implements AutoRouterInterface
4646

4747
/**
4848
* An array of params to the controller method.
49+
*
50+
* @phpstan-var list<string>
4951
*/
5052
private array $params = [];
5153

@@ -72,6 +74,8 @@ final class AutoRouterImproved implements AutoRouterInterface
7274

7375
/**
7476
* The URI segments.
77+
*
78+
* @phpstan-var list<string>
7579
*/
7680
private array $segments = [];
7781

@@ -279,6 +283,7 @@ public function getRoute(string $uri, string $httpVerb): array
279283
}
280284

281285
// The first item may be a method name.
286+
/** @phpstan-var list<string> $params */
282287
$params = $this->params;
283288

284289
$methodParam = array_shift($params);

0 commit comments

Comments
 (0)