8000 Merge branch '4.4' into 5.1 · symfony/doctrine-bridge@b803ad1 · GitHub
[go: up one dir, main page]

Skip to content

Commit b803ad1

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: [HttpFoundation] Drop int return type from parseFilesize() Added $translator->addLoader() bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException fix spelling Add check for constant in Curl client Revert #38614, add assert to avoid regression Fix problem when SYMFONY_PHPUNIT_VERSION is empty string value Update PHP CS Fixer config to v2.18
2 parents 6c3aa2e + b062a6b commit b803ad1

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