Skip to content

Commit

Permalink
refactor: Update for Symfony >= 5.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jul 19, 2022
1 parent 2eb1f48 commit fa5b2dc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 25 deletions.
3 changes: 1 addition & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
totallyTyped="true"
errorLevel="4"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Nyholm\Psr7\Response;
use PhpSpec\ObjectBehavior;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\User;
use Symfony\Component\Security\Core\User\InMemoryUser;

class EuLoginUserProviderSpec extends ObjectBehavior
{
Expand All @@ -31,7 +31,7 @@ public function it_can_check_if_the_user_class_is_supported()
->shouldReturn(true);

$this
->supportsClass(User::class)
->supportsClass(InMemoryUser::class)
->shouldReturn(false);
}

Expand Down Expand Up @@ -235,7 +235,7 @@ public function it_can_refresh_a_user(EuLoginUserInterface $user)
{
$this
->shouldThrow(UnsupportedUserException::class)
->during('refreshUser', [new User('foo', 'bar')]);
->during('refreshUser', [new InMemoryUser('foo', 'bar')]);

$this
->refreshUser($user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function it_is_initializable()
->shouldBeNull();

$this
->getUser()
->getUserIdentifier()
->shouldReturn('username');

$this
Expand Down Expand Up @@ -299,10 +299,7 @@ public function let()
$response = new Response(200, ['Content-Type' => 'application/xml'], $body);
$data = (new Introspector())->parse($response)['serviceResponse']['authenticationSuccess'];

$user = new CasUser($data);

$this
->beConstructedWith($user);
$this->beConstructedWith(new CasUser($data));
}

private function getAttributesData(): array
Expand Down
15 changes: 0 additions & 15 deletions src/Security/Core/User/EuLoginUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,21 +256,6 @@ public function getUid(): ?string
return $this->user->getAttribute('uid');
}

/**
* @deprecated use getUserIdentifier() instead
*/
public function getUser(): string
{
trigger_deprecation(
'ecphp/eu-login-bundle',
'2.2.3',
'The method "%s::getUser()" is deprecated, use %s::getUserIdentifier() instead.',
EuLoginUser::class
);

return $this->user->getUsername();
}

public function getUserIdentifier()
{
return $this->user->getUserIdentifier();
Expand Down

0 comments on commit fa5b2dc

Please sign in to comment.