Skip to content

Commit d38c2df

Browse files
minor #42490 More return type fixes (bis) (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- More return type fixes (bis) | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- c6a20b4e4d More return type fixes (bis)
2 parents b2f286b + 75d34f9 commit d38c2df

File tree

3 files changed

+37
-36
lines changed

3 files changed

+37
-36
lines changed

Authenticator/AbstractAuthenticator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ abstract class AbstractAuthenticator implements AuthenticatorInterface
2828
/**
2929
* Shortcut to create a PostAuthenticationToken for you, if you don't really
3030
* care about which authenticated token you're using.
31-
*
32-
* @return PostAuthenticationToken
3331
*/
3432
public function createToken(Passport $passport, string $firewallName): TokenInterface
3533
{

Authenticator/Passport/PassportTrait.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ trait PassportTrait
2020
{
2121
private $badges = [];
2222

23+
/**
24+
* @return $this
25+
*/
2326
public function addBadge(BadgeInterface $badge): PassportInterface
2427
{
2528
$this->badges[\get_class($badge)] = $badge;

Tests/LoginLink/LoginLinkHandlerTest.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -203,40 +203,6 @@ private function createLinker(array $options = [], array $extraProperties = ['em
203203
}
204204
}
205205

206-
class TestLoginLinkHandlerUserProvider implements UserProviderInterface
207-
{
208-
private $users = [];
209-
210-
public function createUser(TestLoginLinkHandlerUser $user): void
211-
{
212-
$this->users[$user->getUserIdentifier()] = $user;
213-
}
214-
215-
public function loadUserByUsername($username): TestLoginLinkHandlerUser
216-
{
217-
return $this->loadUserByIdentifier($username);
218-
}
219-
220-
public function loadUserByIdentifier(string $userIdentifier): TestLoginLinkHandlerUser
221-
{
222-
if (!isset($this->users[$userIdentifier])) {
223-
throw new UserNotFoundException();
224-
}
225-
226-
return clone $this->users[$userIdentifier];
227-
}
228-
229-
public function refreshUser(UserInterface $user)
230-
{
231-
return $this->users[$username];
232-
}
233-
234-
public function supportsClass(string $class)
235-
{
236-
return TestLoginLinkHandlerUser::class === $class;
237-
}
238-
}
239-
240206
class TestLoginLinkHandlerUser implements UserInterface
241207
{
242208
public $username;
@@ -281,3 +247,37 @@ public function eraseCredentials()
281247
{
282248
}
283249
}
250+
251+
class TestLoginLinkHandlerUserProvider implements UserProviderInterface
252+
{
253+
private $users = [];
254+
255+
public function createUser(TestLoginLinkHandlerUser $user): void
256+
{
257+
$this->users[$user->getUserIdentifier()] = $user;
258+
}
259+
260+
public function loadUserByUsername($username): TestLoginLinkHandlerUser
261+
{
262+
return $this->loadUserByIdentifier($username);
263+
}
264+
265+
public function loadUserByIdentifier(string $userIdentifier): TestLoginLinkHandlerUser
266+
{
267+
if (!isset($this->users[$userIdentifier])) {
268+
throw new UserNotFoundException();
269+
}
270+
271+
return clone $this->users[$userIdentifier];
272+
}
273+
274+
public function refreshUser(UserInterface $user)
275+
{
276+
return $this->users[$username];
277+
}
278+
279+
public function supportsClass(string $class)
280+
{
281+
return TestLoginLinkHandlerUser::class === $class;
282+
}
283+
}

0 commit comments

Comments
 (0)