3030use PHPStan \Rules \Properties \ReadWritePropertiesExtensionProvider ;
3131use PHPStan \Testing \PHPStanTestCase ;
3232use PHPStan \Type \FileTypeMapper ;
33+ use PHPUnit \Framework \Attributes \DataProvider ;
3334use stdClass ;
3435use function array_map ;
3536use function array_merge ;
@@ -195,9 +196,9 @@ public static function dataIgnoreErrorByPathAndCount(): iterable
195196 }
196197
197198 /**
198- * @dataProvider dataIgnoreErrorByPathAndCount
199199 * @param mixed[] $ignoreErrors
200200 */
201+ #[DataProvider('dataIgnoreErrorByPathAndCount ' )]
201202 public function testIgnoreErrorByPathAndCount (array $ ignoreErrors ): void
202203 {
203204 $ result = $ this ->runAnalyser ($ ignoreErrors , true , __DIR__ . '/data/two-fails.php ' , false );
@@ -212,9 +213,7 @@ public static function dataTrueAndFalse(): array
212213 ];
213214 }
214215
215- /**
216- * @dataProvider dataTrueAndFalse
217- */
216+ #[DataProvider('dataTrueAndFalse ' )]
218217 public function testIgnoreErrorByPathAndIdentifierCountsCorrectly (bool $ onlyFiles ): void
219218 {
220219 $ ignoreErrors = [
@@ -238,9 +237,7 @@ public function testIgnoreErrorByPathAndIdentifierCountsCorrectly(bool $onlyFile
238237 $ this ->assertNoErrors ($ result );
239238 }
240239
241- /**
242- * @dataProvider dataTrueAndFalse
243- */
240+ #[DataProvider('dataTrueAndFalse ' )]
244241 public function testIgnoreErrorByPathAndCountMoreThanExpected (bool $ onlyFiles ): void
245242 {
246243 $ ignoreErrors = [
@@ -269,9 +266,7 @@ public function testIgnoreErrorByPathAndCountMoreThanExpected(bool $onlyFiles):
269266 $ this ->assertSamePaths (__DIR__ . '/data/two-fails.php ' , $ result [2 ]->getFile ());
270267 }
271268
272- /**
273- * @dataProvider dataTrueAndFalse
274- */
269+ #[DataProvider('dataTrueAndFalse ' )]
275270 public function testIgnoreErrorByPathAndCountLessThanExpected (bool $ onlyFiles ): void
276271 {
277272 $ ignoreErrors = [
@@ -434,9 +429,7 @@ public static function dataIgnoreErrorInTraitUsingClassFilePath(): array
434429 ];
435430 }
436431
437- /**
438- * @dataProvider dataIgnoreErrorInTraitUsingClassFilePath
439- */
432+ #[DataProvider('dataIgnoreErrorInTraitUsingClassFilePath ' )]
440433 public function testIgnoreErrorInTraitUsingClassFilePath (string $ pathToIgnore ): void
441434 {
442435 $ ignoreErrors = [
@@ -487,9 +480,7 @@ public function testReportMultipleParserErrorsAtOnce(): void
487480 $ this ->assertSame (10 , $ errorTwo ->getLine ());
488481 }
489482
490- /**
491- * @dataProvider dataTrueAndFalse
492- */
483+ #[DataProvider('dataTrueAndFalse ' )]
493484 public function testDoNotReportUnmatchedIgnoredErrorsFromPathIfPathWasNotAnalysed (bool $ onlyFiles ): void
494485 {
495486 $ ignoreErrors = [
@@ -508,9 +499,7 @@ public function testDoNotReportUnmatchedIgnoredErrorsFromPathIfPathWasNotAnalyse
508499 $ this ->assertNoErrors ($ result );
509500 }
510501
511- /**
512- * @dataProvider dataTrueAndFalse
513- */
502+ #[DataProvider('dataTrueAndFalse ' )]
514503 public function testDoNotReportUnmatchedIgnoredErrorsFromPathWithCountIfPathWasNotAnalysed (bool $ onlyFiles ): void
515504 {
516505 $ ignoreErrors = [
@@ -559,9 +548,7 @@ public function testIgnoreNextLineUnmatched(): void
559548 }
560549 }
561550
562- /**
563- * @dataProvider dataTrueAndFalse
564- */
551+ #[DataProvider('dataTrueAndFalse ' )]
565552 public function testIgnoreLine (bool $ reportUnmatchedIgnoredErrors ): void
566553 {
567554 $ result = $ this ->runAnalyser ([], $ reportUnmatchedIgnoredErrors , [
0 commit comments