diff --git a/Exception/MappingException.php b/Exception/MappingException.php index bc4b1d6..1ffef94 100644 --- a/Exception/MappingException.php +++ b/Exception/MappingException.php @@ -23,6 +23,9 @@ public static function missingHeaderOption(): self return new self('When using HeaderReference, "header" option is required'); } + /** + * @param array $columns + */ public static function ambiguousHeader(string $header, array $columns): self { return new self(sprintf('Ambiguous header "%1$s" found, used in columns "%2$s"', $header, implode('", "', $columns))); diff --git a/Test/FilterIteratorTest.php b/Test/FilterIteratorTest.php index a8402da..b7e9ccc 100644 --- a/Test/FilterIteratorTest.php +++ b/Test/FilterIteratorTest.php @@ -29,7 +29,10 @@ public function testCanFilterOutIteratorItems(): void { $iterator = new FakeIterator([1, 2, 3, 4, 5]); $filter = new FilterIterator($iterator, static function (object $item): bool { - /** @var int $scalar */ + /** + * @var int $scalar + * @phpstan-ignore-next-line + */ $scalar = $item->scalar; return $scalar % 2 === 0; @@ -42,7 +45,10 @@ public function testCallbackReturnValueMustBeBool(): void { $iterator = new FakeIterator(['ba', 'abba', 'boo', 'bae', 'nba', 'ab', 'ban']); $filter = new FilterIterator($iterator, static function (object $item): bool { - /** @var string $scalar */ + /** + * @var string $scalar + * @phpstan-ignore-next-line + */ $scalar = $item->scalar; return false !== mb_strpos($scalar, 'ba'); diff --git a/Test/FixtureTrait.php b/Test/FixtureTrait.php index 5f234e8..ce151d2 100644 --- a/Test/FixtureTrait.php +++ b/Test/FixtureTrait.php @@ -28,6 +28,7 @@ private function invalidFixture(string $name): \SplFileObject return new class(__DIR__.'/resources/fixtures/'.$name) extends \SplFileObject { /** * @psalm-suppress ImplementedReturnTypeMismatch Invalid by design + * @phpstan-ignore-next-line */ public function getRealPath(): bool { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a8ec9dd..0ae8962 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -12,9 +12,3 @@ parameters: excludes_analyse: - var/ - vendor/ - ignoreErrors: - - message: '#Access to an undefined property object\:\:\$scalar\.#' - path: %currentWorkingDirectory%/Test/FilterIteratorTest.php - - message: '#Return type \(bool\) of method class@anonymous\/Test\/FixtureTrait\.php:28::getRealPath\(\) should be covariant with return type \(string\|false\) of method SplFileInfo::getRealPath\(\)#' - paths: - - %currentWorkingDirectory%/Test/Functional/FunctionalTestCase.php diff --git a/psalm.xml.dist b/psalm.xml.dist index 5e7c26d..a9f6071 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -1,7 +1,7 @@ + errorLevel="1">