diff --git a/.github/settings.yml b/.github/settings.yml
index e203a5d8..3b26b74e 100644
--- a/.github/settings.yml
+++ b/.github/settings.yml
@@ -82,6 +82,7 @@ repository:
has_pages: false
has_projects: false
has_wiki: false
+ is_template: false
name: "phpstan-rules"
private: false
diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml
index 2429066a..b4a1cd0d 100644
--- a/.github/workflows/integrate.yaml
+++ b/.github/workflows/integrate.yaml
@@ -30,7 +30,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "xdebug"
- extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
@@ -39,6 +39,9 @@ jobs:
- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
+ - name: "Validate composer.json and composer.lock"
+ run: "composer validate --ansi --strict"
+
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"
@@ -93,7 +96,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "none"
- extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
@@ -121,7 +124,7 @@ jobs:
run: "composer normalize --ansi --dry-run"
- name: "Create cache directory for friendsofphp/php-cs-fixer"
- run: "mkdir -p .build/php-cs-fixer"
+ run: "mkdir -p .build/php-cs-fixer/"
- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/cache@v3.3.1"
@@ -159,13 +162,16 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "none"
- extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
tools: "phive"
- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
+ - name: "Validate composer.json and composer.lock"
+ run: "composer validate --ansi --strict"
+
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"
@@ -210,12 +216,15 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "xdebug"
- extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
+ - name: "Validate composer.json and composer.lock"
+ run: "composer validate --ansi --strict"
+
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"
@@ -257,12 +266,15 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "none"
- extensions: "none, ctype, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
+ - name: "Validate composer.json and composer.lock"
+ run: "composer validate --ansi --strict"
+
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"
@@ -279,7 +291,7 @@ jobs:
dependencies: "${{ matrix.dependencies }}"
- name: "Create cache directory for rector/rector"
- run: "mkdir -p .build/rector"
+ run: "mkdir -p .build/rector/"
- name: "Cache cache directory for rector/rector"
uses: "actions/cache@v3.3.1"
@@ -314,7 +326,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "none"
- extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
@@ -323,6 +335,21 @@ jobs:
- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"
+ - name: "Determine composer cache directory"
+ uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"
+
+ - name: "Cache dependencies installed with composer"
+ uses: "actions/cache@v3.3.1"
+ with:
+ path: "${{ env.COMPOSER_CACHE_DIR }}"
+ key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
+ restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
+
+ - name: "Install ${{ matrix.dependencies }} dependencies with composer"
+ uses: "ergebnis/.github/actions/composer/install@1.8.0"
+ with:
+ dependencies: "${{ matrix.dependencies }}"
+
- name: "Check installed packages for security vulnerability advisories"
run: "composer audit --ansi"
@@ -353,6 +380,9 @@ jobs:
- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
+ - name: "Validate composer.json and composer.lock"
+ run: "composer validate --ansi --strict"
+
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"
@@ -369,13 +399,13 @@ jobs:
dependencies: "${{ matrix.dependencies }}"
- name: "Create cache directory for phpstan/phpstan"
- run: "mkdir -p .build/phpstan"
+ run: "mkdir -p .build/phpstan/"
- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1"
- name: "Create cache directory for vimeo/psalm"
- run: "mkdir -p .build/psalm"
+ run: "mkdir -p .build/psalm/"
- name: "Run vimeo/psalm"
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"
@@ -404,7 +434,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "none"
- extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
@@ -413,6 +443,9 @@ jobs:
- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
+ - name: "Validate composer.json and composer.lock"
+ run: "composer validate --ansi --strict"
+
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"
diff --git a/.github/workflows/renew.yaml b/.github/workflows/renew.yaml
index 84271082..b4f06703 100644
--- a/.github/workflows/renew.yaml
+++ b/.github/workflows/renew.yaml
@@ -30,7 +30,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
with:
coverage: "none"
- extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
+ extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
diff --git a/.gitignore b/.gitignore
index c6b4dc9c..f1cf866a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
/.build/
-/.notes/
+/.note/
/.phive/
/vendor/
!/.phive/phars.xml
diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index cb7c35ec..e0babe22 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -32,12 +32,11 @@
->exclude([
'.build/',
'.github/',
- '.notes/',
+ '.note/',
'test/Fixture/',
])
->ignoreDotFiles(false)
- ->in(__DIR__)
- ->name('.php-cs-fixer.php');
+ ->in(__DIR__);
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php-cs-fixer.cache');
diff --git a/.yamllint.yaml b/.yamllint.yaml
index b2129ac2..af99fe0f 100644
--- a/.yamllint.yaml
+++ b/.yamllint.yaml
@@ -2,7 +2,7 @@ extends: "default"
ignore: |
.build/
- .notes/
+ .note/
vendor/
rules:
diff --git a/Makefile b/Makefile
index 1a419688..f5296884 100644
--- a/Makefile
+++ b/Makefile
@@ -11,8 +11,8 @@ coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer.
yamllint -c .yamllint.yaml --strict .
composer normalize
mkdir -p .build/php-cs-fixer/
- vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.fixture.php --diff --verbose
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --verbose
+ vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.fixture.php --diff --verbose
.PHONY: dependency-analysis
dependency-analysis: phive vendor ## Runs a dependency analysis with maglnet/composer-require-checker
diff --git a/README.md b/README.md
index 7e9954c0..eccd667e 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@
[![Latest Stable Version](https://poser.pugx.org/ergebnis/phpstan-rules/v/stable)](https://packagist.org/packages/ergebnis/phpstan-rules)
[![Total Downloads](https://poser.pugx.org/ergebnis/phpstan-rules/downloads)](https://packagist.org/packages/ergebnis/phpstan-rules)
+[![Monthly Downloads](http://poser.pugx.org/ergebnis/phpstan-rules/d/monthly)](https://packagist.org/packages/ergebnis/phpstan-rules)
Provides additional rules for [`phpstan/phpstan`](https://github.com/phpstan/phpstan).
@@ -531,6 +532,10 @@ Please have a look at [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).
Please have a look at [`CODE_OF_CONDUCT.md`](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).
+## Security Policy
+
+Please have a look at [`SECURITY.md`](.github/SECURITY.md).
+
## License
This package is licensed using the MIT License.
diff --git a/composer.json b/composer.json
index 4a9b1389..19e38e5d 100644
--- a/composer.json
+++ b/composer.json
@@ -30,6 +30,7 @@
"ergebnis/composer-normalize": "^2.31.0",
"ergebnis/license": "^2.1.0",
"ergebnis/php-cs-fixer-config": "^5.6.0",
+ "ergebnis/phpunit-slow-test-detector": "^2.3.0",
"infection/infection": "~0.27.0",
"nette/di": "^3.1.2",
"phpstan/phpstan-deprecation-rules": "^1.0.0",
diff --git a/composer.lock b/composer.lock
index b9f6b111..e83d4eea 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "1741e34851615c37daa77cf4bd1cccd0",
+ "content-hash": "feb1e64fbe1f2078a1ce161c318d34f9",
"packages": [
{
"name": "nikic/php-parser",
@@ -2239,6 +2239,74 @@
},
"time": "2023-05-17T13:17:28+00:00"
},
+ {
+ "name": "ergebnis/phpunit-slow-test-detector",
+ "version": "2.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ergebnis/phpunit-slow-test-detector.git",
+ "reference": "ea03f0fb94a8ba8b2428d5dbbdcda3aa2f6b529a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ergebnis/phpunit-slow-test-detector/zipball/ea03f0fb94a8ba8b2428d5dbbdcda3aa2f6b529a",
+ "reference": "ea03f0fb94a8ba8b2428d5dbbdcda3aa2f6b529a",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~8.1.0 || ~8.2.0",
+ "phpunit/phpunit": "^10.1.3"
+ },
+ "require-dev": {
+ "ergebnis/composer-normalize": "^2.31.0",
+ "ergebnis/data-provider": "^1.3.0",
+ "ergebnis/license": "^2.1.0",
+ "ergebnis/php-cs-fixer-config": "^5.7.0",
+ "fakerphp/faker": "^1.22.0",
+ "psalm/plugin-phpunit": "~0.18.4",
+ "rector/rector": "~0.16.0",
+ "vimeo/psalm": "^5.12.0"
+ },
+ "suggest": {
+ "phpunit/phpunit": "^10.0.1"
+ },
+ "type": "library",
+ "extra": {
+ "composer-normalize": {
+ "indent-size": 2,
+ "indent-style": "space"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Ergebnis\\PHPUnit\\SlowTestDetector\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Andreas Möller",
+ "email": "am@localheinz.com"
+ }
+ ],
+ "description": "Provides facilities for detecting slow tests in phpunit/phpunit.",
+ "homepage": "https://github.com/ergebnis/phpunit-slow-test-detector",
+ "keywords": [
+ "detector",
+ "extension",
+ "phpunit",
+ "slow",
+ "test"
+ ],
+ "support": {
+ "issues": "https://github.com/ergebnis/phpunit-slow-test-detector/issues",
+ "source": "https://github.com/ergebnis/phpunit-slow-test-detector"
+ },
+ "time": "2023-05-30T17:23:26+00:00"
+ },
{
"name": "felixfbecker/advanced-json-rpc",
"version": "v3.2.1",
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 4b934fea..196ac9fc 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -217,9 +217,165 @@
$error,
]
-
- iterable
- iterable
-
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
+
+
+
+ provideCasesWhereAnalysisShouldFail
+ provideCasesWhereAnalysisShouldSucceed
+
diff --git a/rector.php b/rector.php
index 913b1fec..217061ae 100644
--- a/rector.php
+++ b/rector.php
@@ -13,6 +13,7 @@
use Rector\Config;
use Rector\Core;
+use Rector\Php81;
use Rector\PHPUnit;
return static function (Config\RectorConfig $rectorConfig): void {
@@ -25,7 +26,11 @@
$rectorConfig->phpVersion(Core\ValueObject\PhpVersion::PHP_81);
+ $rectorConfig->rules([
+ Php81\Rector\Property\ReadOnlyPropertyRector::class,
+ ]);
+
$rectorConfig->sets([
- PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
+ PHPUnit\Set\PHPUnitSetList::PHPUNIT_100,
]);
};
diff --git a/src/Classes/FinalRule.php b/src/Classes/FinalRule.php
index 50e971db..0b6c2401 100644
--- a/src/Classes/FinalRule.php
+++ b/src/Classes/FinalRule.php
@@ -36,12 +36,12 @@ final class FinalRule implements Rule
private static array $whitelistedAttributes = [
'Doctrine\ORM\Mapping\Entity',
];
- private bool $allowAbstractClasses;
+ private readonly bool $allowAbstractClasses;
/**
* @var array
*/
- private array $classesNotRequiredToBeAbstractOrFinal;
+ private readonly array $classesNotRequiredToBeAbstractOrFinal;
private string $errorMessageTemplate = 'Class %s is not final.';
/**
diff --git a/src/Classes/NoExtendsRule.php b/src/Classes/NoExtendsRule.php
index 6698d46f..d8df52f8 100644
--- a/src/Classes/NoExtendsRule.php
+++ b/src/Classes/NoExtendsRule.php
@@ -30,7 +30,7 @@ final class NoExtendsRule implements Rule
/**
* @var array
*/
- private array $classesAllowedToBeExtended;
+ private readonly array $classesAllowedToBeExtended;
/**
* @param array $classesAllowedToBeExtended
diff --git a/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php b/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php
index 22cef109..1ce042d4 100644
--- a/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php
+++ b/src/Classes/PHPUnit/Framework/TestCaseWithSuffixRule.php
@@ -27,7 +27,7 @@ final class TestCaseWithSuffixRule implements Rules\Rule
private static array $phpunitTestCaseClassNames = [
'PHPUnit\Framework\TestCase',
];
- private Reflection\ReflectionProvider $reflectionProvider;
+ private readonly Reflection\ReflectionProvider $reflectionProvider;
public function __construct(Reflection\ReflectionProvider $reflectionProvider)
{
diff --git a/src/Methods/NoParameterWithContainerTypeDeclarationRule.php b/src/Methods/NoParameterWithContainerTypeDeclarationRule.php
index bb22fd2a..90894b20 100644
--- a/src/Methods/NoParameterWithContainerTypeDeclarationRule.php
+++ b/src/Methods/NoParameterWithContainerTypeDeclarationRule.php
@@ -21,17 +21,17 @@
final class NoParameterWithContainerTypeDeclarationRule implements Rule
{
- private Reflection\ReflectionProvider $reflectionProvider;
+ private readonly Reflection\ReflectionProvider $reflectionProvider;
/**
* @var array
*/
- private array $interfacesImplementedByContainers;
+ private readonly array $interfacesImplementedByContainers;
/**
* @var array
*/
- private array $methodsAllowedToUseContainerTypeDeclarations;
+ private readonly array $methodsAllowedToUseContainerTypeDeclarations;
/**
* @param array $interfacesImplementedByContainers
diff --git a/test/Fixture/Classes/NoExtendsRule/Success/ClassExtendingPhpUnitFrameworkTestCase.php b/test/Fixture/Classes/NoExtendsRule/Success/ClassExtendingPhpUnitFrameworkTestCase.php
index 33539d28..b4ff9f3a 100644
--- a/test/Fixture/Classes/NoExtendsRule/Success/ClassExtendingPhpUnitFrameworkTestCase.php
+++ b/test/Fixture/Classes/NoExtendsRule/Success/ClassExtendingPhpUnitFrameworkTestCase.php
@@ -6,11 +6,7 @@
use PHPUnit\Framework;
-/**
- * @internal
- *
- * @coversNothing
- */
+#[Framework\Attributes\CoversNothing]
final class ClassExtendingPhpUnitFrameworkTestCase extends Framework\TestCase
{
}
diff --git a/test/Fixture/Classes/NoExtendsRuleWithClassesAllowedToBeExtended/Success/ClassExtendingPhpUnitFrameworkTestCase.php b/test/Fixture/Classes/NoExtendsRuleWithClassesAllowedToBeExtended/Success/ClassExtendingPhpUnitFrameworkTestCase.php
index a540ddef..5ea44c63 100644
--- a/test/Fixture/Classes/NoExtendsRuleWithClassesAllowedToBeExtended/Success/ClassExtendingPhpUnitFrameworkTestCase.php
+++ b/test/Fixture/Classes/NoExtendsRuleWithClassesAllowedToBeExtended/Success/ClassExtendingPhpUnitFrameworkTestCase.php
@@ -6,11 +6,7 @@
use PHPUnit\Framework;
-/**
- * @internal
- *
- * @coversNothing
- */
+#[Framework\Attributes\CoversNothing]
final class ClassExtendingPhpUnitFrameworkTestCase extends Framework\TestCase
{
}
diff --git a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/AbstractTestCase.php b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/AbstractTestCase.php
index 2ca8b4d9..29d546c9 100644
--- a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/AbstractTestCase.php
+++ b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/AbstractTestCase.php
@@ -6,9 +6,6 @@
use PHPUnit\Framework;
-/**
- * @internal
- */
abstract class AbstractTestCase extends Framework\TestCase
{
}
diff --git a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseExtendingAbstractTestCaseWithoutTestSuffix.php b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseExtendingAbstractTestCaseWithoutTestSuffix.php
index 9d54471e..b15b9894 100644
--- a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseExtendingAbstractTestCaseWithoutTestSuffix.php
+++ b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseExtendingAbstractTestCaseWithoutTestSuffix.php
@@ -4,11 +4,7 @@
namespace Ergebnis\PHPStan\Rules\Test\Fixture\Classes\PHPUnit\Framework\TestCaseWithSuffixRule\Failure;
-/**
- * @internal
- *
- * @coversNothing
- */
+#[Framework\Attributes\CoversNothing]
final class ConcreteTestCaseExtendingAbstractTestCaseWithoutTestSuffix extends AbstractTestCase
{
}
diff --git a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseWithoutTestSuffix.php b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseWithoutTestSuffix.php
index 812c61b2..703c89cc 100644
--- a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseWithoutTestSuffix.php
+++ b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Failure/ConcreteTestCaseWithoutTestSuffix.php
@@ -6,11 +6,7 @@
use PHPUnit\Framework;
-/**
- * @internal
- *
- * @coversNothing
- */
+#[Framework\Attributes\CoversNothing]
final class ConcreteTestCaseWithoutTestSuffix extends Framework\TestCase
{
public function testFooIsNotBar(): void
diff --git a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ConcreteTestCaseWithSuffixTest.php b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ConcreteTestCaseWithSuffixTest.php
index 8aacc16a..4c355420 100644
--- a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ConcreteTestCaseWithSuffixTest.php
+++ b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ConcreteTestCaseWithSuffixTest.php
@@ -6,11 +6,7 @@
use PHPUnit\Framework;
-/**
- * @internal
- *
- * @coversNothing
- */
+#[Framework\Attributes\CoversNothing]
final class ConcreteTestCaseWithSuffixTest extends Framework\TestCase
{
public function testFooIsNotBar(): void
diff --git a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ExplicitlyAbstractTestCase.php b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ExplicitlyAbstractTestCase.php
index 416aadbd..882d7973 100644
--- a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ExplicitlyAbstractTestCase.php
+++ b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ExplicitlyAbstractTestCase.php
@@ -6,9 +6,6 @@
use PHPUnit\Framework;
-/**
- * @internal
- */
abstract class ExplicitlyAbstractTestCase extends Framework\TestCase
{
}
diff --git a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ImplicitlyAbstractTestCase.php b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ImplicitlyAbstractTestCase.php
index a07f5f72..13931359 100644
--- a/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ImplicitlyAbstractTestCase.php
+++ b/test/Fixture/Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ImplicitlyAbstractTestCase.php
@@ -6,11 +6,7 @@
use PHPUnit\Framework;
-/**
- * @internal
- *
- * @coversNothing
- */
+#[Framework\Attributes\CoversNothing]
class ImplicitlyAbstractTestCase extends Framework\TestCase
{
abstract protected function foo();
diff --git a/test/Integration/AbstractTestCase.php b/test/Integration/AbstractTestCase.php
index 92fcfc9d..9aa25f76 100644
--- a/test/Integration/AbstractTestCase.php
+++ b/test/Integration/AbstractTestCase.php
@@ -14,15 +14,11 @@
namespace Ergebnis\PHPStan\Rules\Test\Integration;
use PHPStan\Testing\RuleTestCase;
+use PHPUnit\Framework;
-/**
- * @internal
- */
abstract class AbstractTestCase extends RuleTestCase
{
- /**
- * @dataProvider provideCasesWhereAnalysisShouldSucceed
- */
+ #[Framework\Attributes\DataProvider('provideCasesWhereAnalysisShouldSucceed')]
final public function testAnalysisSucceeds(string $path): void
{
self::assertFileExists($path);
@@ -35,9 +31,7 @@ final public function testAnalysisSucceeds(string $path): void
);
}
- /**
- * @dataProvider provideCasesWhereAnalysisShouldFail
- */
+ #[Framework\Attributes\DataProvider('provideCasesWhereAnalysisShouldFail')]
final public function testAnalysisFails(string $path, array $error): void
{
self::assertFileExists($path);
diff --git a/test/Integration/Classes/FinalRuleTest.php b/test/Integration/Classes/FinalRuleTest.php
index 191929fd..aeec7c14 100644
--- a/test/Integration/Classes/FinalRuleTest.php
+++ b/test/Integration/Classes/FinalRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Classes\FinalRule
- */
+#[Framework\Attributes\CoversClass(Classes\FinalRule::class)]
final class FinalRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Classes/FinalRuleWithAbstractClassesAllowedTest.php b/test/Integration/Classes/FinalRuleWithAbstractClassesAllowedTest.php
index b0a2cac2..2c0b10b9 100644
--- a/test/Integration/Classes/FinalRuleWithAbstractClassesAllowedTest.php
+++ b/test/Integration/Classes/FinalRuleWithAbstractClassesAllowedTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Classes\FinalRule
- */
+#[Framework\Attributes\CoversClass(Classes\FinalRule::class)]
final class FinalRuleWithAbstractClassesAllowedTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Classes/FinalRuleWithAttributesTest.php b/test/Integration/Classes/FinalRuleWithAttributesTest.php
index 475bcfa4..5fe1d0ef 100644
--- a/test/Integration/Classes/FinalRuleWithAttributesTest.php
+++ b/test/Integration/Classes/FinalRuleWithAttributesTest.php
@@ -16,14 +16,9 @@
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Classes\FinalRule
- *
- * @requires PHP 8.0
- */
+#[Framework\Attributes\CoversClass(Classes\FinalRule::class)]
final class FinalRuleWithAttributesTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Classes/FinalRuleWithExcludedClassNamesTest.php b/test/Integration/Classes/FinalRuleWithExcludedClassNamesTest.php
index 6c638017..84161bb6 100644
--- a/test/Integration/Classes/FinalRuleWithExcludedClassNamesTest.php
+++ b/test/Integration/Classes/FinalRuleWithExcludedClassNamesTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Classes\FinalRule
- */
+#[Framework\Attributes\CoversClass(Classes\FinalRule::class)]
final class FinalRuleWithExcludedClassNamesTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Classes/NoExtendsRuleTest.php b/test/Integration/Classes/NoExtendsRuleTest.php
index 917c80d1..70846265 100644
--- a/test/Integration/Classes/NoExtendsRuleTest.php
+++ b/test/Integration/Classes/NoExtendsRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
- */
+#[Framework\Attributes\CoversClass(Classes\NoExtendsRule::class)]
final class NoExtendsRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Classes/NoExtendsRuleWithClassesAllowedToBeExtendedTest.php b/test/Integration/Classes/NoExtendsRuleWithClassesAllowedToBeExtendedTest.php
index 532bc571..ac5696fd 100644
--- a/test/Integration/Classes/NoExtendsRuleWithClassesAllowedToBeExtendedTest.php
+++ b/test/Integration/Classes/NoExtendsRuleWithClassesAllowedToBeExtendedTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Classes;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
- */
+#[Framework\Attributes\CoversClass(Classes\NoExtendsRule::class)]
final class NoExtendsRuleWithClassesAllowedToBeExtendedTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Classes/PHPUnit/Framework/TestCaseWithSuffixRuleTest.php b/test/Integration/Classes/PHPUnit/Framework/TestCaseWithSuffixRuleTest.php
index a7e6910f..8c6bf5b9 100644
--- a/test/Integration/Classes/PHPUnit/Framework/TestCaseWithSuffixRuleTest.php
+++ b/test/Integration/Classes/PHPUnit/Framework/TestCaseWithSuffixRuleTest.php
@@ -18,11 +18,7 @@
use PHPStan\Rules\Rule;
use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Classes\PHPUnit\Framework\TestCaseWithSuffixRule
- */
+#[Framework\Attributes\CoversClass(Classes\PHPUnit\Framework\TestCaseWithSuffixRule::class)]
final class TestCaseWithSuffixRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
@@ -51,7 +47,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
Test\Fixture\Classes\PHPUnit\Framework\TestCaseWithSuffixRule\Failure\ConcreteTestCaseExtendingAbstractTestCaseWithoutTestSuffix::class,
Framework\TestCase::class,
),
- 12,
+ 7,
],
],
'concrete-test-case-without-test-suffix' => [
@@ -62,7 +58,7 @@ public static function provideCasesWhereAnalysisShouldFail(): iterable
Test\Fixture\Classes\PHPUnit\Framework\TestCaseWithSuffixRule\Failure\ConcreteTestCaseWithoutTestSuffix::class,
Framework\TestCase::class,
),
- 14,
+ 9,
],
],
];
diff --git a/test/Integration/Closures/NoNullableReturnTypeDeclarationRuleTest.php b/test/Integration/Closures/NoNullableReturnTypeDeclarationRuleTest.php
index 0223c639..11e45390 100644
--- a/test/Integration/Closures/NoNullableReturnTypeDeclarationRuleTest.php
+++ b/test/Integration/Closures/NoNullableReturnTypeDeclarationRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Closures;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
- */
+#[Framework\Attributes\CoversClass(Closures\NoNullableReturnTypeDeclarationRule::class)]
final class NoNullableReturnTypeDeclarationRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Closures/NoParameterWithNullDefaultValueRuleTest.php b/test/Integration/Closures/NoParameterWithNullDefaultValueRuleTest.php
index 192a298e..7c4f04ff 100644
--- a/test/Integration/Closures/NoParameterWithNullDefaultValueRuleTest.php
+++ b/test/Integration/Closures/NoParameterWithNullDefaultValueRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Closures;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullDefaultValueRule
- */
+#[Framework\Attributes\CoversClass(Closures\NoParameterWithNullDefaultValueRule::class)]
final class NoParameterWithNullDefaultValueRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Closures/NoParameterWithNullableTypeDeclarationRuleTest.php b/test/Integration/Closures/NoParameterWithNullableTypeDeclarationRuleTest.php
index 8235cbad..e1040f2a 100644
--- a/test/Integration/Closures/NoParameterWithNullableTypeDeclarationRuleTest.php
+++ b/test/Integration/Closures/NoParameterWithNullableTypeDeclarationRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Closures;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule
- */
+#[Framework\Attributes\CoversClass(Closures\NoParameterWithNullableTypeDeclarationRule::class)]
final class NoParameterWithNullableTypeDeclarationRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Expressions/NoCompactRuleTest.php b/test/Integration/Expressions/NoCompactRuleTest.php
index cdf02afd..6b1819f8 100644
--- a/test/Integration/Expressions/NoCompactRuleTest.php
+++ b/test/Integration/Expressions/NoCompactRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Expressions;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Expressions\NoCompactRule
- */
+#[Framework\Attributes\CoversClass(Expressions\NoCompactRule::class)]
final class NoCompactRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Expressions/NoErrorSuppressionRuleTest.php b/test/Integration/Expressions/NoErrorSuppressionRuleTest.php
index 8ad8f66e..fa682e6f 100644
--- a/test/Integration/Expressions/NoErrorSuppressionRuleTest.php
+++ b/test/Integration/Expressions/NoErrorSuppressionRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Expressions;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Expressions\NoErrorSuppressionRule
- */
+#[Framework\Attributes\CoversClass(Expressions\NoErrorSuppressionRule::class)]
final class NoErrorSuppressionRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Expressions/NoEvalRuleTest.php b/test/Integration/Expressions/NoEvalRuleTest.php
index f2d41036..5bb6bfba 100644
--- a/test/Integration/Expressions/NoEvalRuleTest.php
+++ b/test/Integration/Expressions/NoEvalRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Expressions;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Expressions\NoEvalRule
- */
+#[Framework\Attributes\CoversClass(Expressions\NoEvalRule::class)]
final class NoEvalRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Expressions/NoIssetRuleTest.php b/test/Integration/Expressions/NoIssetRuleTest.php
index 56c52186..f22a8bd4 100644
--- a/test/Integration/Expressions/NoIssetRuleTest.php
+++ b/test/Integration/Expressions/NoIssetRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Expressions;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Expressions\NoIssetRule
- */
+#[Framework\Attributes\CoversClass(Expressions\NoIssetRule::class)]
final class NoIssetRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Files/DeclareStrictTypesRuleTest.php b/test/Integration/Files/DeclareStrictTypesRuleTest.php
index eff4f1f6..a7d94cc6 100644
--- a/test/Integration/Files/DeclareStrictTypesRuleTest.php
+++ b/test/Integration/Files/DeclareStrictTypesRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Files;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
- */
+#[Framework\Attributes\CoversClass(Files\DeclareStrictTypesRule::class)]
final class DeclareStrictTypesRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Functions/NoNullableReturnTypeDeclarationRuleTest.php b/test/Integration/Functions/NoNullableReturnTypeDeclarationRuleTest.php
index 993bcd75..a3e66d54 100644
--- a/test/Integration/Functions/NoNullableReturnTypeDeclarationRuleTest.php
+++ b/test/Integration/Functions/NoNullableReturnTypeDeclarationRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Functions;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule
- */
+#[Framework\Attributes\CoversClass(Functions\NoNullableReturnTypeDeclarationRule::class)]
final class NoNullableReturnTypeDeclarationRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Functions/NoParameterWithNullDefaultValueRuleTest.php b/test/Integration/Functions/NoParameterWithNullDefaultValueRuleTest.php
index 0e038f0c..c7d69bda 100644
--- a/test/Integration/Functions/NoParameterWithNullDefaultValueRuleTest.php
+++ b/test/Integration/Functions/NoParameterWithNullDefaultValueRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Functions;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullDefaultValueRule
- */
+#[Framework\Attributes\CoversClass(Functions\NoParameterWithNullDefaultValueRule::class)]
final class NoParameterWithNullDefaultValueRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Functions/NoParameterWithNullableTypeDeclarationRuleTest.php b/test/Integration/Functions/NoParameterWithNullableTypeDeclarationRuleTest.php
index f0f6cef5..5a326f5b 100644
--- a/test/Integration/Functions/NoParameterWithNullableTypeDeclarationRuleTest.php
+++ b/test/Integration/Functions/NoParameterWithNullableTypeDeclarationRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Functions;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullableTypeDeclarationRule
- */
+#[Framework\Attributes\CoversClass(Functions\NoParameterWithNullableTypeDeclarationRule::class)]
final class NoParameterWithNullableTypeDeclarationRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Methods/FinalInAbstractClassRuleTest.php b/test/Integration/Methods/FinalInAbstractClassRuleTest.php
index def45b4a..639f7351 100644
--- a/test/Integration/Methods/FinalInAbstractClassRuleTest.php
+++ b/test/Integration/Methods/FinalInAbstractClassRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Methods;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Methods\FinalInAbstractClassRule
- */
+#[Framework\Attributes\CoversClass(Methods\FinalInAbstractClassRule::class)]
final class FinalInAbstractClassRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Methods/NoConstructorParameterWithDefaultValueRuleTest.php b/test/Integration/Methods/NoConstructorParameterWithDefaultValueRuleTest.php
index bc1287a0..7d26ca96 100644
--- a/test/Integration/Methods/NoConstructorParameterWithDefaultValueRuleTest.php
+++ b/test/Integration/Methods/NoConstructorParameterWithDefaultValueRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Methods;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Methods\NoConstructorParameterWithDefaultValueRule
- */
+#[Framework\Attributes\CoversClass(Methods\NoConstructorParameterWithDefaultValueRule::class)]
final class NoConstructorParameterWithDefaultValueRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Methods/NoNullableReturnTypeDeclarationRuleTest.php b/test/Integration/Methods/NoNullableReturnTypeDeclarationRuleTest.php
index eaa17d84..74391e36 100644
--- a/test/Integration/Methods/NoNullableReturnTypeDeclarationRuleTest.php
+++ b/test/Integration/Methods/NoNullableReturnTypeDeclarationRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Methods;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Methods\NoNullableReturnTypeDeclarationRule
- */
+#[Framework\Attributes\CoversClass(Methods\NoNullableReturnTypeDeclarationRule::class)]
final class NoNullableReturnTypeDeclarationRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Methods/NoParameterWithContainerTypeDeclarationRuleTest.php b/test/Integration/Methods/NoParameterWithContainerTypeDeclarationRuleTest.php
index 7e0264d1..f45b2593 100644
--- a/test/Integration/Methods/NoParameterWithContainerTypeDeclarationRuleTest.php
+++ b/test/Integration/Methods/NoParameterWithContainerTypeDeclarationRuleTest.php
@@ -16,13 +16,10 @@
use Ergebnis\PHPStan\Rules\Methods;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
use Psr\Container;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Methods\NoParameterWithContainerTypeDeclarationRule
- */
+#[Framework\Attributes\CoversClass(Methods\NoParameterWithContainerTypeDeclarationRule::class)]
final class NoParameterWithContainerTypeDeclarationRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Methods/NoParameterWithNullDefaultValueRuleTest.php b/test/Integration/Methods/NoParameterWithNullDefaultValueRuleTest.php
index 9bfb7998..092ffac3 100644
--- a/test/Integration/Methods/NoParameterWithNullDefaultValueRuleTest.php
+++ b/test/Integration/Methods/NoParameterWithNullDefaultValueRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Methods;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Methods\NoParameterWithNullDefaultValueRule
- */
+#[Framework\Attributes\CoversClass(Methods\NoParameterWithNullDefaultValueRule::class)]
final class NoParameterWithNullDefaultValueRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Methods/NoParameterWithNullableTypeDeclarationRuleTest.php b/test/Integration/Methods/NoParameterWithNullableTypeDeclarationRuleTest.php
index 35aeb323..ca19bd2a 100644
--- a/test/Integration/Methods/NoParameterWithNullableTypeDeclarationRuleTest.php
+++ b/test/Integration/Methods/NoParameterWithNullableTypeDeclarationRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Methods;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Methods\NoParameterWithNullableTypeDeclarationRule
- */
+#[Framework\Attributes\CoversClass(Methods\NoParameterWithNullableTypeDeclarationRule::class)]
final class NoParameterWithNullableTypeDeclarationRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Methods/PrivateInFinalClassRuleTest.php b/test/Integration/Methods/PrivateInFinalClassRuleTest.php
index c5c0ee11..0f45bb31 100644
--- a/test/Integration/Methods/PrivateInFinalClassRuleTest.php
+++ b/test/Integration/Methods/PrivateInFinalClassRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Methods;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Methods\PrivateInFinalClassRule
- */
+#[Framework\Attributes\CoversClass(Methods\PrivateInFinalClassRule::class)]
final class PrivateInFinalClassRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable
diff --git a/test/Integration/Statements/NoSwitchRuleTest.php b/test/Integration/Statements/NoSwitchRuleTest.php
index dcb8a568..8b3609dc 100644
--- a/test/Integration/Statements/NoSwitchRuleTest.php
+++ b/test/Integration/Statements/NoSwitchRuleTest.php
@@ -16,12 +16,9 @@
use Ergebnis\PHPStan\Rules\Statements;
use Ergebnis\PHPStan\Rules\Test;
use PHPStan\Rules\Rule;
+use PHPUnit\Framework;
-/**
- * @internal
- *
- * @covers \Ergebnis\PHPStan\Rules\Statements\NoSwitchRule
- */
+#[Framework\Attributes\CoversClass(Statements\NoSwitchRule::class)]
final class NoSwitchRuleTest extends Test\Integration\AbstractTestCase
{
public static function provideCasesWhereAnalysisShouldSucceed(): iterable