-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UnusedClosureUsesRule for already traversed match
Closes phpstan/phpstan-phpunit#190
- Loading branch information
1 parent
5b7bb23
commit a719486
Showing
4 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php // lint >= 8.1 | ||
|
||
namespace PhpstanPhpUnit190; | ||
|
||
class FoobarTest | ||
{ | ||
public function testBaz(): int | ||
{ | ||
$matcher = new self(); | ||
$this->acceptCallback(static function (string $test) use ($matcher): string { | ||
match ($matcher->testBaz()) { | ||
1 => 1, | ||
2 => 2, | ||
default => new \LogicException() | ||
}; | ||
|
||
return $test; | ||
}); | ||
|
||
return 1; | ||
} | ||
|
||
public function acceptCallback(callable $cb): void | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters