From 17e2867a4caae61a295d32811838de24a112c5a4 Mon Sep 17 00:00:00 2001 From: Oliver Kossin Date: Wed, 24 Jul 2024 19:41:24 +0200 Subject: [PATCH] Add Symfony 7 support (#172) --------- Co-authored-by: Alexander Schranz --- Command/InitCommand.php | 2 +- DependencyInjection/Configuration.php | 2 +- Validator/Constraints/Blocked.php | 2 +- Validator/Constraints/Exist.php | 2 +- composer.json | 42 +++--- phpstan-baseline.neon | 197 ++++++++------------------ phpstan.neon | 1 - 7 files changed, 86 insertions(+), 162 deletions(-) diff --git a/Command/InitCommand.php b/Command/InitCommand.php index 39c196e..c2985f4 100644 --- a/Command/InitCommand.php +++ b/Command/InitCommand.php @@ -72,7 +72,7 @@ public function configure(): void ->addArgument('webspace', null, 'A specific webspace key.'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { /** @var string|null $webspaceKey */ $webspaceKey = $input->getArgument('webspace'); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index cc9cdcb..ce86caf 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -91,7 +91,7 @@ class Configuration implements ConfigurationInterface public const LAST_LOGIN = 'last_login'; public const REFRESH_INTERVAL = 'refresh_interval'; - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('sulu_community'); $rootNode = $treeBuilder->getRootNode(); diff --git a/Validator/Constraints/Blocked.php b/Validator/Constraints/Blocked.php index 2fd8ba2..dff54bb 100644 --- a/Validator/Constraints/Blocked.php +++ b/Validator/Constraints/Blocked.php @@ -23,7 +23,7 @@ class Blocked extends Constraint */ public $message = 'The email "%email%" is blocked.'; - public function validatedBy() + public function validatedBy(): string { return 'blocked_validator'; } diff --git a/Validator/Constraints/Exist.php b/Validator/Constraints/Exist.php index 0e06b73..35b9fb2 100644 --- a/Validator/Constraints/Exist.php +++ b/Validator/Constraints/Exist.php @@ -33,7 +33,7 @@ class Exist extends Constraint */ public $entity = ''; - public function validatedBy() + public function validatedBy(): string { return 'exist_validator'; } diff --git a/composer.json b/composer.json index 24ad0f8..02bb5c2 100644 --- a/composer.json +++ b/composer.json @@ -10,43 +10,43 @@ "doctrine/orm": "^2.5.3", "doctrine/persistence": "^1.3 || ^2.0 || ^3.0", "doctrine/phpcr-bundle": "^2 || ^3.0", - "jms/serializer-bundle": "^3.3 || ^4.0", + "jms/serializer-bundle": "^3.3 || ^4.0|| ^5.4", "massive/build-bundle": "^0.3 || ^0.4 || ^0.5", "sulu/sulu": "^2.4.0 || ^2.6@dev", - "symfony/config": "^5.4 || ^6.2", - "symfony/console": "^5.4 || ^6.2", - "symfony/dependency-injection": "^5.4 || ^6.2", - "symfony/event-dispatcher": "^5.4 || ^6.2", - "symfony/form": "^5.4 || ^6.2", - "symfony/framework-bundle": "^5.4 || ^6.2", - "symfony/http-foundation": "^5.4 || ^6.2", - "symfony/http-kernel": "^5.4 || ^6.2", - "symfony/intl": "^5.4 || ^6.2", - "symfony/mailer": "^5.4 || ^6.2", - "symfony/routing": "^5.4 || ^6.2", - "symfony/security-bundle": "^5.4 || ^6.2" + "symfony/config": "^5.4 || ^6.2 || ^7.0", + "symfony/console": "^5.4 || ^6.2 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.2 || ^7.0", + "symfony/form": "^5.4 || ^6.2 || ^7.0", + "symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0", + "symfony/http-foundation": "^5.4 || ^6.2 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.2 || ^7.0", + "symfony/intl": "^5.4 || ^6.2 || ^7.0", + "symfony/mailer": "^5.4 || ^6.2 || ^7.0", + "symfony/routing": "^5.4 || ^6.2 || ^7.0", + "symfony/security-bundle": "^5.4 || ^6.2 || ^7.0" }, "require-dev": { "doctrine/data-fixtures": "^1.3.3", "friendsofsymfony/jsrouting-bundle": "^2.6 || ^3.0", "handcraftedinthealps/zendsearch": "^2.0", - "jackalope/jackalope-doctrine-dbal": "^1.3.4", + "jackalope/jackalope-doctrine-dbal": "^1.3.4 || ^2.0", "jangregor/phpstan-prophecy": "^1.0", "massive/search-bundle": "^2.0", "php-cs-fixer/shim": "^3.9", "phpspec/prophecy": "^1.16", - "phpstan/phpstan": "1.0", + "phpstan/phpstan": "^1.0", "phpstan/phpstan-doctrine": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-symfony": "^1.0", "phpunit/phpunit": "^8.2", - "symfony/browser-kit": "^5.4 || ^6.2", - "symfony/css-selector": "^5.4 || ^6.2", - "symfony/dotenv": "^5.4 || ^6.2", + "symfony/browser-kit": "^5.4 || ^6.2 || ^7.0", + "symfony/css-selector": "^5.4 || ^6.2 || ^7.0", + "symfony/dotenv": "^5.4 || ^6.2 || ^7.0", "symfony/monolog-bundle": "^3.1", - "symfony/phpunit-bridge": "^5.4 || ^6.2", - "symfony/stopwatch": "^5.4 || ^6.2", - "symfony/var-dumper": "^5.4 || ^6.2", + "symfony/phpunit-bridge": "^5.4 || ^6.2 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.2 || ^7.0", + "symfony/var-dumper": "^5.4 || ^6.2 || ^7.0", "thecodingmachine/phpstan-strict-rules": "^1.0" }, "conflict": { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f35cf76..65c7832 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -11,34 +11,29 @@ parameters: path: Controller/AbstractController.php - - message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:getSubscribedServices\\(\\) should return array\\ but returns array\\\\.$#" + message: "#^If condition is always false\\.$#" count: 1 path: Controller/AbstractController.php - - message: "#^PHPDoc tag @var for variable \\$encoder contains unknown class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\UserPasswordEncoderInterface\\.$#" + message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:getSubscribedServices\\(\\) should return array\\ but returns array\\\\.$#" count: 1 path: Controller/AbstractController.php - - message: "#^Strict comparison using \\=\\=\\= between true and array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} will always evaluate to false\\.$#" - count: 1 - path: Controller/BlacklistConfirmationController.php - - - - message: "#^If condition is always true\\.$#" + message: "#^PHPDoc tag @var for variable \\$encoder contains unknown class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\UserPasswordEncoderInterface\\.$#" count: 1 - path: Controller/CompletionController.php + path: Controller/AbstractController.php - - message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/CompletionController.php + message: "#^Parameter \\#1 \\$type of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:getConfigTypeProperty\\(\\) expects 'blacklist_confirmed'\\|'blacklist_denied'\\|'blacklisted'\\|'completion'\\|'confirmation'\\|'email_confirmation'\\|'firewall'\\|'from'\\|'login'\\|'maintenance'\\|'password_forget'\\|'password_reset'\\|'profile'\\|'registration'\\|'role'\\|'to'\\|'webspace_key', string given\\.$#" + count: 2 + path: Controller/AbstractController.php - - message: "#^Parameter \\#1 \\$url of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:redirect\\(\\) expects string, array\\\\|string\\>\\|string given\\.$#" - count: 1 - path: Controller/CompletionController.php + message: "#^Unable to resolve the template type TConfig in call to method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:getConfigTypeProperty\\(\\)$#" + count: 2 + path: Controller/AbstractController.php - message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:completion\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#" @@ -50,124 +45,29 @@ parameters: count: 1 path: Controller/CompletionController.php - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: Controller/CompletionController.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: Controller/ConfirmationController.php - - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/ConfirmationController.php - - - - message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Routing\\\\Generator\\\\UrlGeneratorInterface\\:\\:generate\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/ConfirmationController.php - - - - message: "#^Parameter \\#1 \\$url of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:redirect\\(\\) expects string, array\\\\|string\\>\\|string given\\.$#" - count: 1 - path: Controller/ConfirmationController.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: Controller/ConfirmationController.php - - - - message: "#^Parameter \\#1 \\$view of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:render\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/LoginController.php - - - - message: "#^If condition is always true\\.$#" - count: 2 - path: Controller/PasswordController.php - - message: "#^Parameter \\#1 \\$emailUsername of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:passwordForget\\(\\) expects string, mixed given\\.$#" count: 1 path: Controller/PasswordController.php - - - message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 2 - path: Controller/PasswordController.php - - - - message: "#^Parameter \\#1 \\$url of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:redirect\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 2 - path: Controller/PasswordController.php - - message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#" count: 1 path: Controller/PasswordController.php - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 2 - path: Controller/PasswordController.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: Controller/ProfileController.php - - - - message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/ProfileController.php - - - - message: "#^Parameter \\#1 \\$url of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:redirect\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/ProfileController.php - - message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#" count: 1 path: Controller/ProfileController.php - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: Controller/ProfileController.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: Controller/RegistrationController.php - - - - message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/RegistrationController.php - - - - message: "#^Parameter \\#1 \\$url of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:redirect\\(\\) expects string, array\\\\|string\\> given\\.$#" - count: 1 - path: Controller/RegistrationController.php - - message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#" count: 1 path: Controller/RegistrationController.php - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: Controller/RegistrationController.php - - message: "#^Cannot access offset 'template' on mixed\\.$#" - count: 3 + count: 2 path: DependencyInjection/CompilerPass/CommunityManagerCompilerPass.php - @@ -211,52 +111,57 @@ parameters: path: DependencyInjection/CompilerPass/CommunityValidatorCompilerPass.php - - message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Event\\\\AbstractCommunityEvent\\:\\:getConfigProperty\\(\\) should return array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} but returns array\\\\|string\\.$#" + message: "#^Class Sulu\\\\Bundle\\\\CommunityBundle\\\\Entity\\\\BlacklistItemRepository extends generic class Sulu\\\\Component\\\\Persistence\\\\Repository\\\\ORM\\\\EntityRepository but does not specify its types\\: T$#" count: 1 - path: Event/AbstractCommunityEvent.php + path: Entity/BlacklistItemRepository.php - - message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Event\\\\AbstractCommunityEvent\\:\\:getConfigTypeProperty\\(\\) should return array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} but returns array\\|bool\\|string\\|null\\.$#" + message: "#^Class Sulu\\\\Bundle\\\\CommunityBundle\\\\Entity\\\\BlacklistUserRepository extends generic class Sulu\\\\Component\\\\Persistence\\\\Repository\\\\ORM\\\\EntityRepository but does not specify its types\\: T$#" count: 1 - path: Event/AbstractCommunityEvent.php + path: Entity/BlacklistUserRepository.php - - message: "#^Offset TTypeConfigProperty of string does not exist on array\\\\|string\\.$#" + message: "#^Class Sulu\\\\Bundle\\\\CommunityBundle\\\\Entity\\\\EmailConfirmationTokenRepository extends generic class Sulu\\\\Component\\\\Persistence\\\\Repository\\\\ORM\\\\EntityRepository but does not specify its types\\: T$#" + count: 1 + path: Entity/EmailConfirmationTokenRepository.php + + - + message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Event\\\\AbstractCommunityEvent\\:\\:getConfigProperty\\(\\) has invalid return type Sulu\\\\Bundle\\\\CommunityBundle\\\\Event\\\\TTypeConfig\\.$#" count: 1 path: Event/AbstractCommunityEvent.php - - message: "#^Parameter \\#1 \\$from of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string\\> given\\.$#" + message: "#^Offset TTypeConfigProperty of 'activate_user'\\|'auto_login'\\|'delete_user'\\|'email'\\|'embed_template'\\|'enabled'\\|'options'\\|'redirect_to'\\|'service'\\|'template'\\|'type' does not exist on array\\\\|string\\.$#" count: 1 - path: EventListener/BlacklistListener.php + path: Event/AbstractCommunityEvent.php - - message: "#^Parameter \\#2 \\$to of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string\\> given\\.$#" + message: "#^Parameter \\#1 \\$from of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string given\\.$#" count: 1 path: EventListener/BlacklistListener.php - - message: "#^Parameter \\#2 \\$webspaceKey of class Sulu\\\\Bundle\\\\CommunityBundle\\\\Entity\\\\BlacklistUser constructor expects string, array\\\\|string\\> given\\.$#" + message: "#^Parameter \\#2 \\$to of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string given\\.$#" count: 1 path: EventListener/BlacklistListener.php - - message: "#^Parameter \\#3 \\$config of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\{subject\\: string, user_template\\: string\\|null, admin_template\\: string\\|null\\}, array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} given\\.$#" + message: "#^Parameter \\#2 \\$webspaceKey of class Sulu\\\\Bundle\\\\CommunityBundle\\\\Entity\\\\BlacklistUser constructor expects string, array\\\\|string given\\.$#" count: 1 path: EventListener/BlacklistListener.php - - message: "#^Parameter \\#1 \\$from of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string\\> given\\.$#" + message: "#^Offset 'firewall' on array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} on left side of \\?\\? always exists and is not nullable\\.$#" count: 1 - path: EventListener/EmailConfirmationListener.php + path: EventListener/CompletionListener.php - - message: "#^Parameter \\#2 \\$to of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string\\> given\\.$#" + message: "#^Parameter \\#1 \\$from of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string given\\.$#" count: 1 path: EventListener/EmailConfirmationListener.php - - message: "#^Parameter \\#3 \\$config of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\{subject\\: string, user_template\\: string\\|null, admin_template\\: string\\|null\\}, array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} given\\.$#" + message: "#^Parameter \\#2 \\$to of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string given\\.$#" count: 1 path: EventListener/EmailConfirmationListener.php @@ -296,49 +201,59 @@ parameters: path: Mail/MailFactory.php - - message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManager\\:\\:getConfigProperty\\(\\) should return array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} but returns array\\\\|string\\.$#" + message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManager\\:\\:getConfigProperty\\(\\) has invalid return type Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\TTypeConfig\\.$#" count: 1 path: Manager/CommunityManager.php - - message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManager\\:\\:getConfigTypeProperty\\(\\) should return array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} but returns array\\|bool\\|string\\|null\\.$#" + message: "#^Parameter \\#1 \\$from of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string given\\.$#" count: 1 path: Manager/CommunityManager.php - - message: "#^Parameter \\#1 \\$enabled of method Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User\\:\\:setEnabled\\(\\) expects bool, array\\\\|string\\> given\\.$#" - count: 2 + message: "#^Parameter \\#1 \\$type of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManager\\:\\:getConfigTypeProperty\\(\\) expects TConfig of 'blacklist_confirmed'\\|'blacklist_denied'\\|'blacklisted'\\|'completion'\\|'confirmation'\\|'email_confirmation'\\|'firewall'\\|'from'\\|'login'\\|'maintenance'\\|'password_forget'\\|'password_reset'\\|'profile'\\|'registration'\\|'role'\\|'to'\\|'webspace_key', string given\\.$#" + count: 1 path: Manager/CommunityManager.php - - message: "#^Parameter \\#1 \\$from of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string\\> given\\.$#" + message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, array\\\\|string given\\.$#" count: 1 path: Manager/CommunityManager.php - - message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, array\\\\|string given\\.$#" + message: "#^Parameter \\#2 \\$firewallName of class Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\UsernamePasswordToken constructor expects string, array\\\\|string given\\.$#" count: 1 path: Manager/CommunityManager.php - - message: "#^Parameter \\#2 \\$firewallName of class Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\UsernamePasswordToken constructor expects string, array\\\\|string\\> given\\.$#" + message: "#^Parameter \\#2 \\$to of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string given\\.$#" count: 1 path: Manager/CommunityManager.php - - message: "#^Parameter \\#2 \\$to of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\\\|string, array\\\\|string\\> given\\.$#" + message: "#^Parameter \\#3 \\$config of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\{subject\\: string, user_template\\: string\\|null, admin_template\\: string\\|null\\}, array\\|bool\\|string\\|null given\\.$#" count: 1 path: Manager/CommunityManager.php - - message: "#^Parameter \\#3 \\$config of static method Sulu\\\\Bundle\\\\CommunityBundle\\\\Mail\\\\Mail\\:\\:create\\(\\) expects array\\{subject\\: string, user_template\\: string\\|null, admin_template\\: string\\|null\\}, array\\{from\\: array\\\\|string, to\\: array\\\\|string, webspace_key\\: string, role\\: string, firewall\\: string, maintenance\\: array\\{enabled\\: bool, template\\: string\\}, login\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, registration\\: array\\{enabled\\: bool, template\\: string, service\\: string\\|null, embed_template\\: string, type\\: string, options\\: array, activate_user\\: bool, auto_login\\: bool, \\.\\.\\.\\}, \\.\\.\\.\\} given\\.$#" + message: "#^Parameter \\#3 \\$roleName of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\UserManagerInterface\\:\\:createUser\\(\\) expects string, array\\\\|string given\\.$#" count: 1 path: Manager/CommunityManager.php - - message: "#^Parameter \\#3 \\$roleName of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\UserManagerInterface\\:\\:createUser\\(\\) expects string, array\\\\|string\\> given\\.$#" + message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:getConfigProperty\\(\\) has invalid return type Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\TTypeConfig\\.$#" count: 1 - path: Manager/CommunityManager.php + path: Manager/CommunityManagerInterface.php + + - + message: "#^Method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\UserManager\\:\\:__construct\\(\\) has parameter \\$contactManager with generic interface Sulu\\\\Bundle\\\\ContactBundle\\\\Contact\\\\ContactManagerInterface but does not specify its types\\: DoctrineEntity, ApiEntity, AddressRelationEntity$#" + count: 1 + path: Manager/UserManager.php + + - + message: "#^Property Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\UserManager\\:\\:\\$contactManager with generic interface Sulu\\\\Bundle\\\\ContactBundle\\\\Contact\\\\ContactManagerInterface does not specify its types\\: DoctrineEntity, ApiEntity, AddressRelationEntity$#" + count: 1 + path: Manager/UserManager.php - message: "#^If condition is always true\\.$#" @@ -355,3 +270,13 @@ parameters: count: 3 path: Tests/Functional/Controller/RegistrationTest.php + - + message: "#^Access to an undefined property Sulu\\\\Bundle\\\\CommunityBundle\\\\Tests\\\\Unit\\\\Controller\\\\SaveMediaTraitTest\\:\\:\\$container\\.$#" + count: 2 + path: Tests/Unit/Controller/SaveMediaTraitTest.php + + - + message: "#^PHPDoc tag @var for variable \\$repository contains generic class Doctrine\\\\ORM\\\\EntityRepository but does not specify its types\\: TEntityClass$#" + count: 1 + path: Validator/Constraints/ExistValidator.php + diff --git a/phpstan.neon b/phpstan.neon index 93a2d7a..b397865 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -19,6 +19,5 @@ parameters: container_xml_path: %currentWorkingDirectory%/Tests/Application/var/cache/admin/dev/Sulu_Bundle_CommunityBundle_Tests_Application_KernelDevDebugContainer.xml console_application_loader: Tests/phpstan/console-application.php constant_hassers: false - checkGenericClassInNonGenericObjectType: false doctrine: objectManagerLoader: Tests/phpstan/object-manager.php