From e03745004f53ca5b5d9100a7be805e7f1901d979 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Sun, 17 Dec 2023 20:12:38 +0000 Subject: [PATCH 1/5] DevKit updates --- .php-cs-fixer.dist.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 1afe2e232..d197afd5b 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -27,8 +27,9 @@ HEADER; $rules = [ - '@PHP74Migration' => true, - '@PHP74Migration:risky' => true, + '@PHP80Migration' => true, + '@PHP80Migration:risky' => true, + '@PHPUnit84Migration:risky' => true, '@PSR12' => true, '@PSR12:risky' => true, '@Symfony' => true, @@ -42,6 +43,7 @@ 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], 'no_useless_else' => true, 'no_useless_return' => true, + 'no_superfluous_elseif' => true, 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true], 'ordered_class_elements' => true, @@ -51,16 +53,14 @@ ['phpstan-template', 'phpstan-template-covariant', 'phpstan-extends', 'phpstan-implements', 'phpstan-var', 'psalm-var', 'phpstan-param', 'psalm-param', 'phpstan-return', 'psalm-return'], ['psalm-suppress', 'phpstan-ignore-next-line'], ['Assert\\*'], - ['ODM\\*'], - ['ORM\\*'], ]], - 'php_unit_strict' => true, - 'php_unit_test_case_static_method_calls' => true, 'php_unit_data_provider_name' => true, 'php_unit_data_provider_return_type' => true, + 'php_unit_strict' => true, + 'php_unit_test_case_static_method_calls' => true, 'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress', 'phpstan-var']], - 'single_line_throw' => false, 'static_lambda' => true, + 'single_line_throw' => false, 'strict_comparison' => true, 'strict_param' => true, 'void_return' => false, From 9d1783b73ef9f0fec7fbe2c42c41059e0076ba52 Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Tue, 19 Dec 2023 07:47:48 +0100 Subject: [PATCH 2/5] Fix PHPStan --- src/Security/UserProvider.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Security/UserProvider.php b/src/Security/UserProvider.php index 7b52804ec..1c42e2760 100644 --- a/src/Security/UserProvider.php +++ b/src/Security/UserProvider.php @@ -20,6 +20,9 @@ use Symfony\Component\Security\Core\User\UserInterface as SecurityUserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; +/** + * @phpstan-implements UserProviderInterface + */ final class UserProvider implements UserProviderInterface { public function __construct(private UserManagerInterface $userManager) From cb70f8522c43194895054ae9204e65656b6b1e9e Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Tue, 19 Dec 2023 07:55:50 +0100 Subject: [PATCH 3/5] Fix PHPStan --- src/Security/Authorization/Voter/UserAclVoter.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Security/Authorization/Voter/UserAclVoter.php b/src/Security/Authorization/Voter/UserAclVoter.php index 24f359e8c..0cda8cdb8 100644 --- a/src/Security/Authorization/Voter/UserAclVoter.php +++ b/src/Security/Authorization/Voter/UserAclVoter.php @@ -36,8 +36,6 @@ public function supportsAttribute($attribute): bool /** * @param mixed $subject * @param mixed[] $attributes - * - * @return self::ACCESS_* */ public function vote(TokenInterface $token, $subject, array $attributes): int { From fe11b70a9feab1c4a59c8832cd5077ff800acda4 Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Tue, 19 Dec 2023 08:00:33 +0100 Subject: [PATCH 4/5] Fix psalm --- src/Security/Authorization/Voter/UserAclVoter.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Security/Authorization/Voter/UserAclVoter.php b/src/Security/Authorization/Voter/UserAclVoter.php index 0cda8cdb8..7a4c7a0d4 100644 --- a/src/Security/Authorization/Voter/UserAclVoter.php +++ b/src/Security/Authorization/Voter/UserAclVoter.php @@ -36,6 +36,8 @@ public function supportsAttribute($attribute): bool /** * @param mixed $subject * @param mixed[] $attributes + * + * @return self::ACCESS_ABSTAIN|self::ACCESD_DENIED */ public function vote(TokenInterface $token, $subject, array $attributes): int { From 1d3ba64d691d9585039535a8cc522b40d275bb3f Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Tue, 19 Dec 2023 08:02:30 +0100 Subject: [PATCH 5/5] Fix --- src/Security/Authorization/Voter/UserAclVoter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Security/Authorization/Voter/UserAclVoter.php b/src/Security/Authorization/Voter/UserAclVoter.php index 7a4c7a0d4..371da3db6 100644 --- a/src/Security/Authorization/Voter/UserAclVoter.php +++ b/src/Security/Authorization/Voter/UserAclVoter.php @@ -37,7 +37,7 @@ public function supportsAttribute($attribute): bool * @param mixed $subject * @param mixed[] $attributes * - * @return self::ACCESS_ABSTAIN|self::ACCESD_DENIED + * @return self::ACCESS_ABSTAIN|self::ACCESS_DENIED */ public function vote(TokenInterface $token, $subject, array $attributes): int {