From 22d9e0221fa7490dece99b92fcc37bcfa107600c Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 28 Aug 2024 11:39:18 +0200 Subject: [PATCH 1/2] Remove deprecated PHPStan options --- phpstan.neon.dist | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9dbe7b6a..57c2726b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,9 +2,12 @@ includes: - phpstan-baseline.neon parameters: + ignoreErrors: + - + identifier: missingType.iterableValue + - + identifier: missingType.generics paths: - src - tests level: max - checkGenericClassInNonGenericObjectType: false - checkMissingIterableValueType: false From f91bd2f04766511f42bdd2801d134cd581286e2a Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Wed, 28 Aug 2024 14:08:55 +0200 Subject: [PATCH 2/2] fix NoBrokenRefDirective false positive (#1823) --- src/Rule/NoBrokenRefDirective.php | 2 +- tests/Rule/NoBrokenRefDirectiveTest.php | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Rule/NoBrokenRefDirective.php b/src/Rule/NoBrokenRefDirective.php index dad008f6..7ad24a5a 100644 --- a/src/Rule/NoBrokenRefDirective.php +++ b/src/Rule/NoBrokenRefDirective.php @@ -37,7 +37,7 @@ public function check(Lines $lines, int $number, string $filename): ViolationInt $lines->seek($number); $line = $lines->current(); - if ($line->clean()->match('/(:ref\s|ref:)/') && !$line->clean()->match('/:ref:/')) { + if ($line->clean()->match('/(:ref\s|\sref:)/') && !$line->clean()->match('/:ref:/')) { return Violation::from( 'Please use correct syntax for :ref: directive', $filename, diff --git a/tests/Rule/NoBrokenRefDirectiveTest.php b/tests/Rule/NoBrokenRefDirectiveTest.php index 1e65f877..335ff70d 100644 --- a/tests/Rule/NoBrokenRefDirectiveTest.php +++ b/tests/Rule/NoBrokenRefDirectiveTest.php @@ -43,22 +43,22 @@ public static function checkProvider(): iterable 'Please use correct syntax for :ref: directive', 'filename', 1, - 'ref:`Redis section ` below', + 'see ref:`Redis section ` below', ), - new RstSample('ref:`Redis section ` below'), + new RstSample('see ref:`Redis section ` below'), ], [ Violation::from( 'Please use correct syntax for :ref: directive', 'filename', 1, - ':ref `Redis section ` below', + 'see :ref `Redis section ` below', ), - new RstSample(':ref `Redis section ` below'), + new RstSample('see :ref `Redis section ` below'), ], [ NullViolation::create(), - new RstSample(':ref:`Redis section ` below'), + new RstSample('see :ref:`Redis section ` below'), ], [ NullViolation::create(), @@ -68,6 +68,10 @@ public static function checkProvider(): iterable NullViolation::create(), new RstSample('Then use the :method:`Symfony\\Component\\Lock\\LockInterface::refresh` method'), ], + [ + NullViolation::create(), + new RstSample('new Link(href: style.css'), + ], ]; } }