From 271e6e8298e6ef03c54a7ab50fd4ff9cf54d8165 Mon Sep 17 00:00:00 2001 From: core23 Date: Sun, 3 Dec 2023 15:21:00 +0100 Subject: [PATCH] Fix CS --- phpstan-baseline.neon | 5 +++++ psalm-baseline.xml | 6 +++--- src/Action/RequestResetAction.php | 7 +++++++ src/Event/GetResponseNullableUserEvent.php | 4 +--- src/Mailer/NoopResettingMailer.php | 4 +--- src/Security/UserProvider.php | 3 +++ src/Validator/Constraints/Pattern.php | 1 - tests/App/Entity/TestGroup.php | 4 +--- tests/App/Entity/TestUser.php | 4 +--- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 29177f2c..02538e73 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -135,6 +135,11 @@ parameters: count: 1 path: tests/DependencyInjection/NucleosUserExtensionTest.php + - + message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:createStub\\(\\)\\.$#" + count: 1 + path: tests/Form/Type/ResettingFormTypeTest.php + - message: "#^Method Nucleos\\\\UserBundle\\\\Tests\\\\Model\\\\BaseUserManagerTest\\:\\:getUserManager\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index de98bd2e..d17eb44b 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,6 +1,6 @@ - - + + Response @@ -8,7 +8,7 @@ getResponse()]]> - + Response diff --git a/src/Action/RequestResetAction.php b/src/Action/RequestResetAction.php index ff20945d..cf97a65e 100644 --- a/src/Action/RequestResetAction.php +++ b/src/Action/RequestResetAction.php @@ -53,6 +53,9 @@ final class RequestResetAction private readonly int $retryTtl; + /** + * @var UserProviderInterface + */ private readonly UserProviderInterface $userProvider; private readonly TranslatorInterface $translator; @@ -60,6 +63,10 @@ final class RequestResetAction /** * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ + + /** + * @param UserProviderInterface $userProvider + */ public function __construct( Environment $twig, FormFactoryInterface $formFactory, diff --git a/src/Event/GetResponseNullableUserEvent.php b/src/Event/GetResponseNullableUserEvent.php index 5b3747af..4febb3eb 100644 --- a/src/Event/GetResponseNullableUserEvent.php +++ b/src/Event/GetResponseNullableUserEvent.php @@ -13,6 +13,4 @@ namespace Nucleos\UserBundle\Event; -final class GetResponseNullableUserEvent extends GetResponseUserEvent -{ -} +final class GetResponseNullableUserEvent extends GetResponseUserEvent {} diff --git a/src/Mailer/NoopResettingMailer.php b/src/Mailer/NoopResettingMailer.php index 07e680fd..b49574f5 100644 --- a/src/Mailer/NoopResettingMailer.php +++ b/src/Mailer/NoopResettingMailer.php @@ -17,7 +17,5 @@ final class NoopResettingMailer implements ResettingMailer { - public function sendResettingEmailMessage(UserInterface $user): void - { - } + public function sendResettingEmailMessage(UserInterface $user): void {} } diff --git a/src/Security/UserProvider.php b/src/Security/UserProvider.php index f8ad90d4..44d15989 100644 --- a/src/Security/UserProvider.php +++ b/src/Security/UserProvider.php @@ -21,6 +21,9 @@ use Symfony\Component\Security\Core\User\UserInterface as SecurityUserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; +/** + * @phpstan-implements UserProviderInterface + */ class UserProvider implements UserProviderInterface { protected UserManager $userManager; diff --git a/src/Validator/Constraints/Pattern.php b/src/Validator/Constraints/Pattern.php index 211b0bb8..602444d2 100755 --- a/src/Validator/Constraints/Pattern.php +++ b/src/Validator/Constraints/Pattern.php @@ -18,7 +18,6 @@ /** * @Annotation - * * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) */ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] diff --git a/tests/App/Entity/TestGroup.php b/tests/App/Entity/TestGroup.php index 25bf0d7b..8df6bacf 100644 --- a/tests/App/Entity/TestGroup.php +++ b/tests/App/Entity/TestGroup.php @@ -15,6 +15,4 @@ use Nucleos\UserBundle\Model\Group; -class TestGroup extends Group -{ -} +class TestGroup extends Group {} diff --git a/tests/App/Entity/TestUser.php b/tests/App/Entity/TestUser.php index 4bd9fc12..14a9beb8 100644 --- a/tests/App/Entity/TestUser.php +++ b/tests/App/Entity/TestUser.php @@ -19,6 +19,4 @@ /** * @phpstan-extends User */ -class TestUser extends User -{ -} +class TestUser extends User {}