diff options
| author | 2024-04-10 15:33:43 +0200 | |
|---|---|---|
| committer | 2024-04-10 15:33:43 +0200 | |
| commit | 350edf398c55b472e19a3017de9b4d2d3420b9e4 (patch) | |
| tree | 00672f4cba0830e4b39f778e3a36de6b961fc5bb /tests | |
| parent | 8280e3d88edb93211fcf2aec15a7b4c1ae4d3813 (diff) | |
PHP 8.3 #[\Override] (#6273)
* PHP 8.3 #[\Override]
https://php.watch/versions/8.3/override-attr
With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute
And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors)
* Update extension example accordingly
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/app/Models/LogDAOTest.php | 2 | ||||
| -rw-r--r-- | tests/cli/i18n/I18nCompletionValidatorTest.php | 1 | ||||
| -rw-r--r-- | tests/cli/i18n/I18nDataTest.php | 1 | ||||
| -rw-r--r-- | tests/cli/i18n/I18nUsageValidatorTest.php | 1 | ||||
| -rw-r--r-- | tests/phpstan-next.txt | 15 |
5 files changed, 5 insertions, 15 deletions
diff --git a/tests/app/Models/LogDAOTest.php b/tests/app/Models/LogDAOTest.php index 4d9ec0e7d..90261ae55 100644 --- a/tests/app/Models/LogDAOTest.php +++ b/tests/app/Models/LogDAOTest.php @@ -10,6 +10,7 @@ class LogDAOTest extends TestCase { private string $logPath; + #[\Override] protected function setUp(): void { $this->logDAO = new FreshRSS_LogDAO(); $this->logPath = FreshRSS_LogDAO::logPath(self::LOG_FILE_TEST); @@ -36,6 +37,7 @@ class LogDAOTest extends TestCase { self::assertStringContainsString('', file_get_contents($this->logPath) ?: ''); } + #[\Override] protected function tearDown(): void { unlink($this->logPath); } diff --git a/tests/cli/i18n/I18nCompletionValidatorTest.php b/tests/cli/i18n/I18nCompletionValidatorTest.php index 03896c11b..bc992edbe 100644 --- a/tests/cli/i18n/I18nCompletionValidatorTest.php +++ b/tests/cli/i18n/I18nCompletionValidatorTest.php @@ -7,6 +7,7 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase { /** @var I18nValue&PHPUnit\Framework\MockObject\MockObject */ private $value; + #[\Override] public function setUp(): void { $this->value = $this->getMockBuilder(I18nValue::class) ->disableOriginalConstructor() diff --git a/tests/cli/i18n/I18nDataTest.php b/tests/cli/i18n/I18nDataTest.php index 5823d55b8..bbfc92872 100644 --- a/tests/cli/i18n/I18nDataTest.php +++ b/tests/cli/i18n/I18nDataTest.php @@ -9,6 +9,7 @@ class I18nDataTest extends PHPUnit\Framework\TestCase { /** @var I18nValue&PHPUnit\Framework\MockObject\MockObject */ private $value; + #[\Override] public function setUp(): void { $this->value = $this->getMockBuilder(I18nValue::class) ->disableOriginalConstructor() diff --git a/tests/cli/i18n/I18nUsageValidatorTest.php b/tests/cli/i18n/I18nUsageValidatorTest.php index 720cab32e..3135cef22 100644 --- a/tests/cli/i18n/I18nUsageValidatorTest.php +++ b/tests/cli/i18n/I18nUsageValidatorTest.php @@ -7,6 +7,7 @@ class I18nUsageValidatorTest extends PHPUnit\Framework\TestCase { private I18nValue $value; + #[\Override] public function setUp(): void { $this->value = $this->getMockBuilder(I18nValue::class) ->disableOriginalConstructor() diff --git a/tests/phpstan-next.txt b/tests/phpstan-next.txt deleted file mode 100644 index 8e28e66a8..000000000 --- a/tests/phpstan-next.txt +++ /dev/null @@ -1,15 +0,0 @@ -# List of files, which are not yet passing PHPStan level 9 https://phpstan.org/user-guide/rule-levels -# Used for automated tests to avoid regressions in files already passing that level. -# Can be regenerated with something like: -# find . -type d -name 'vendor' -prune -o -name '*.php' -exec sh -c 'vendor/bin/phpstan analyse --level 9 --memory-limit 512M {} >/dev/null 2>/dev/null || echo {}' \; - -./app/Controllers/configureController.php -./app/Controllers/importExportController.php -./app/Models/DatabaseDAO.php -./app/Models/Entry.php -./app/Models/Feed.php -./app/Services/ImportService.php -./app/views/configure/archiving.phtml -./app/views/helpers/feed/update.phtml -./lib/Minz/Helper.php -./lib/Minz/Request.php |
