From 074ecf6cbd73f8fcc7a4cfda5ac42a6d9daf179b Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 25 Dec 2021 02:39:48 +0100 Subject: [PATCH] [TASK] Upgrade PHPStan & friends (#357) Also re-generate the baseline, and update a type annotation to match what the current version of jangregor/phpstan-prophecy now recognizes. --- .../Repository/Product/TeaRepositoryTest.php | 3 +-- composer.json | 8 ++++---- phpstan-baseline.neon | 15 --------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Tests/Unit/Domain/Repository/Product/TeaRepositoryTest.php b/Tests/Unit/Domain/Repository/Product/TeaRepositoryTest.php index 120d05e..3a40cea 100644 --- a/Tests/Unit/Domain/Repository/Product/TeaRepositoryTest.php +++ b/Tests/Unit/Domain/Repository/Product/TeaRepositoryTest.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace TTN\Tea\Tests\Unit\Domain\Repository\Product; use Nimut\TestingFramework\TestCase\UnitTestCase; -use Prophecy\Prophecy\ProphecySubjectInterface; use TTN\Tea\Domain\Repository\Product\TeaRepository; use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; use TYPO3\CMS\Extbase\Persistence\Repository; @@ -21,7 +20,7 @@ class TeaRepositoryTest extends UnitTestCase private $subject; /** - * @var ObjectManagerInterface&ProphecySubjectInterface + * @var ObjectManagerInterface */ protected $objectManager; diff --git a/composer.json b/composer.json index 205c14c..20fc0cc 100644 --- a/composer.json +++ b/composer.json @@ -39,13 +39,13 @@ "ergebnis/composer-normalize": "^2.15.0", "friendsofphp/php-cs-fixer": "^3.2", "helmich/typo3-typoscript-lint": "^2.5.2", - "jangregor/phpstan-prophecy": "^0.8.1", + "jangregor/phpstan-prophecy": "^1.0.0", "nimut/testing-framework": "^6.0.0", "phpstan/extension-installer": "^1.1.0", - "phpstan/phpstan": "^0.12.98", - "phpstan/phpstan-phpunit": "^0.12.22", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.0.0", "phpunit/phpunit": "^8.5.21", - "saschaegerer/phpstan-typo3": "^0.13.3", + "saschaegerer/phpstan-typo3": "^1.0.0", "seld/jsonlint": "^1.8.3", "squizlabs/php_codesniffer": "^3.6.1", "symfony/yaml": "^4.4.29 || ^5.3.6 || ^6.0", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index eed4700..364905f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,17 +1,2 @@ parameters: ignoreErrors: - - - message: "#^Constant TYPO3_version not found\\.$#" - count: 1 - path: Configuration/TCA/tx_tea_domain_model_product_tea.php - - - - message: "#^Constant TYPO3_version not found\\.$#" - count: 1 - path: Tests/Functional/Controller/TeaControllerTest.php - - - - message: "#^Property TTN\\\\Tea\\\\Tests\\\\Unit\\\\Domain\\\\Repository\\\\Product\\\\TeaRepositoryTest\\:\\:\\$objectManager \\(Prophecy\\\\Prophecy\\\\ProphecySubjectInterface&TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManagerInterface\\) does not accept TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManagerInterface\\.$#" - count: 1 - path: Tests/Unit/Domain/Repository/Product/TeaRepositoryTest.php -