Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 3, 2023
1 parent e91ee48 commit 6767add
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.7.7@e028ba46ba0d7f9a78bc3201c251e137383e145f">
<file src="src/Action/UpdateSecurityAction.php">
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<file src="src/Action/ResetAction.php">
<InvalidNullableReturnType>
<code>Response</code>
</InvalidNullableReturnType>
<NullableReturnStatement>
<code><![CDATA[$event->getResponse()]]></code>
</NullableReturnStatement>
</file>
<file src="src/Action/ResetAction.php">
<file src="src/Action/UpdateSecurityAction.php">
<InvalidNullableReturnType>
<code>Response</code>
</InvalidNullableReturnType>
Expand Down
7 changes: 7 additions & 0 deletions src/Action/RequestResetAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@ final class RequestResetAction

private readonly int $retryTtl;

/**
* @var UserProviderInterface<UserInterface>
*/
private readonly UserProviderInterface $userProvider;

private readonly TranslatorInterface $translator;

/**
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/

/**
* @param UserProviderInterface<UserInterface> $userProvider
*/
public function __construct(
Environment $twig,
FormFactoryInterface $formFactory,
Expand Down
4 changes: 1 addition & 3 deletions src/Event/GetResponseNullableUserEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

namespace Nucleos\UserBundle\Event;

final class GetResponseNullableUserEvent extends GetResponseUserEvent
{
}
final class GetResponseNullableUserEvent extends GetResponseUserEvent {}
4 changes: 1 addition & 3 deletions src/Mailer/NoopResettingMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@

final class NoopResettingMailer implements ResettingMailer
{
public function sendResettingEmailMessage(UserInterface $user): void
{
}
public function sendResettingEmailMessage(UserInterface $user): void {}

Check warning on line 20 in src/Mailer/NoopResettingMailer.php

View check run for this annotation

Codecov / codecov/patch

src/Mailer/NoopResettingMailer.php#L20

Added line #L20 was not covered by tests
}
3 changes: 3 additions & 0 deletions src/Security/UserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
use Symfony\Component\Security\Core\User\UserInterface as SecurityUserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;

/**
* @phpstan-extends UserProviderInterface<UserInterface>
*/
class UserProvider implements UserProviderInterface

Check failure on line 27 in src/Security/UserProvider.php

View workflow job for this annotation

GitHub Actions / run / Static Code Analysis (8.3)

Class Nucleos\UserBundle\Security\UserProvider has @extends tag, but does not extend any class.

Check failure on line 27 in src/Security/UserProvider.php

View workflow job for this annotation

GitHub Actions / run / Static Code Analysis (8.3)

Class Nucleos\UserBundle\Security\UserProvider implements generic interface Symfony\Component\Security\Core\User\UserProviderInterface but does not specify its types: TUser
{
protected UserManager $userManager;
Expand Down
1 change: 0 additions & 1 deletion src/Validator/Constraints/Pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

/**
* @Annotation
*
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
Expand Down
4 changes: 1 addition & 3 deletions tests/App/Entity/TestGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@

use Nucleos\UserBundle\Model\Group;

class TestGroup extends Group
{
}
class TestGroup extends Group {}
4 changes: 1 addition & 3 deletions tests/App/Entity/TestUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@
/**
* @phpstan-extends User<GroupInterface>
*/
class TestUser extends User
{
}
class TestUser extends User {}

0 comments on commit 6767add

Please sign in to comment.