fix: PHPStan and test strictness improvements
Add bin/ scripts to PHPStan scanFiles, suppress property.onlyWritten for by-ref test properties, add exhaustive default match arm, use explicit expects() on mock stubs, fix data provider return type, and simplify redundant null check in NotificationServiceTest. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,8 +17,11 @@ final class ModuleEventDispatcherTest extends TestCase
|
||||
|
||||
$listener = new class ($called, $capturedEvent, $capturedPayload) implements EventListener {
|
||||
public function __construct(
|
||||
/** @phpstan-ignore property.onlyWritten */
|
||||
private bool &$called,
|
||||
/** @phpstan-ignore property.onlyWritten */
|
||||
private string &$capturedEvent,
|
||||
/** @phpstan-ignore property.onlyWritten */
|
||||
private array &$capturedPayload
|
||||
) {
|
||||
}
|
||||
@@ -69,7 +72,7 @@ final class ModuleEventDispatcherTest extends TestCase
|
||||
};
|
||||
|
||||
$successListener = new class ($secondCalled) implements EventListener {
|
||||
public function __construct(private bool &$called)
|
||||
public function __construct(/** @phpstan-ignore property.onlyWritten */ private bool &$called)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user