Skip to content

Commit

Permalink
Merge pull request #191 from samsonasik/prepare-to-rector-2
Browse files Browse the repository at this point in the history
Prepare to Rector next 2.0 with PHPStan 2 and PHPParser 5
  • Loading branch information
samsonasik authored Dec 14, 2024
2 parents 7afebaf + b3257ba commit 08cb2f4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"forum": "https://discourse.laminas.dev/"
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 ",
"rector/rector": "1.2.10"
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"rector/rector": "2.0.0-rc1"
},
"require-dev": {
"laminas/laminas-servicemanager": "^4.0",
Expand Down
32 changes: 16 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\UseUse;
use PhpParser\Node\UseItem;
use Rector\Configuration\Option;
use Rector\Configuration\Parameter\SimpleParameterProvider;
use Rector\PhpParser\Node\BetterNodeFinder;
Expand Down Expand Up @@ -180,10 +180,10 @@ private function replaceUseInteropStatementOnAutoImportEnabled(
$uses = array_filter($namespace->stmts, fn (Stmt $stmt): bool => $stmt instanceof Use_);

foreach ($uses as $use) {
/** @var UseUse|false $useUse */
/** @var UseItem|false $useUse */
$useUse = current($use->uses);

if (! $useUse instanceof UseUse) {
if (! $useUse instanceof UseItem) {
continue;
}

Expand Down

0 comments on commit 08cb2f4

Please sign in to comment.