diff --git a/composer.json b/composer.json index c171ef50..d2ae4d22 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "symfony/twig-bundle": "^6.3" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.41", + "friendsofphp/php-cs-fixer": "^3.64", "jangregor/phpstan-prophecy": "^1.0", "phpcr/phpcr-shell": "^1.5", "phpspec/prophecy-phpunit": "^2.1", @@ -63,7 +63,7 @@ "phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-symfony": "^1.3", "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^10.5", "rector/rector": "^1.0", "sulu/sulu-rector": "^1.0", "symfony/browser-kit": "^6.3", diff --git a/rector.php b/rector.php index f21fe731..7341cf12 100644 --- a/rector.php +++ b/rector.php @@ -11,20 +11,15 @@ __DIR__ . '/tests', ]) ->withRootFiles() - ->withPHPStanConfigs([ - __DIR__ . '/phpstan.dist.neon', - // rector does not load phpstan extension automatically so require them manually here: - __DIR__ . '/vendor/phpstan/phpstan-doctrine/extension.neon', - __DIR__ . '/vendor/phpstan/phpstan-symfony/extension.neon', - ]) - ->withImportNames(importShortClasses: false) - ->withPreparedSets(codeQuality: true, doctrineCodeQuality: true) + ->withPhpSets() + ->withPreparedSets(codeQuality: true, doctrineCodeQuality: true, symfonyCodeQuality: true, deadCode: true, codingStyle: true, instanceOf: true, typeDeclarations: true) + ->withImportNames(importShortClasses: false) + ->withAttributesSets(all: true) // symfony rules ->withSymfonyContainerPhp(__DIR__ . '/var/cache/website/dev/App_KernelDevDebugContainer.xml') ->withSets([ - SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, // activate when doing updates: // SymfonyLevelSetList::UP_TO_SYMFONY_63, @@ -34,4 +29,10 @@ // sulu rules // activate for updates when doing updates: // SuluLevelSetList::UP_TO_SULU_25, + ]) + ->withPHPStanConfigs([ + __DIR__ . '/phpstan.dist.neon', + // rector does not load phpstan extension automatically so require them manually here: + __DIR__ . '/vendor/phpstan/phpstan-doctrine/extension.neon', + __DIR__ . '/vendor/phpstan/phpstan-symfony/extension.neon', ]); diff --git a/tests/phpstan/object-manager.php b/tests/phpstan/object-manager.php index 23b549c8..2e2b66ac 100644 --- a/tests/phpstan/object-manager.php +++ b/tests/phpstan/object-manager.php @@ -23,7 +23,7 @@ // this is a workaround for the following phpstan issue: https://github.com/phpstan/phpstan-doctrine/issues/98 $resolveTargetEntityListener = \current(\array_filter( $objectManager->getEventManager()->getListeners('loadClassMetadata'), - static fn ($listener) => $listener instanceof ResolveTargetEntityListener, + static fn ($listener): bool => $listener instanceof ResolveTargetEntityListener, )); if (false !== $resolveTargetEntityListener) {