8000 Merge branch '5.2' into 5.x · symfony/doctrine-bridge@bc921be · GitHub
[go: up one dir, main page]

Skip to content

Commit bc921be

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: [HttpFoundation] Drop int return type from parseFilesize() Added $translator->addLoader() bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException [Uid] Clarify the format returned by getTime() fix spelling Add check for constant in Curl client Revert #38614, add assert to avoid regression Fix container injection with TypedReference Fix problem when SYMFONY_PHPUNIT_VERSION is empty string value Update PHP CS Fixer config to v2.18
2 parents 6929b3b + 089c0f9 commit bc921be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Security/User/EntityUserProvider.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ public function loadUserByUsername(string $username)
6262
}
6363

6464
if (null === $user) {
65-
throw new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
65+
$e = new UsernameNotFoundException(sprintf('User "%s" not found.', $username));
66+
$e->setUsername($username);
67+
68+
throw $e;
6669
}
6770

6871
return $user;
@@ -92,7 +95,10 @@ public function refreshUser(UserInterface $user)
9295

9396
$refreshedUser = $repository->find($id);
9497
if (null === $refreshedUser) {
95-
throw new UsernameNotFoundException('User with id '.json_encode($id).' not found.');
98+
$e = new UsernameNotFoundException('User with id '.json_encode($id).' not found.');
99+
$e->setUsername(json_encode($id));
100+
101+
throw $e;
96102
}
97103
}
98104

0 commit comments

Comments
 (0)
0