8000 feature #23262 Add scalar typehints/return types (chalasr, xabbuh) · symfony/security@f53f6de · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit f53f6de

Browse files
committed
feature #23262 Add scalar typehints/return types (chalasr, xabbuh)
This PR was merged into the 4.0-dev branch. Discussion ---------- Add scalar typehints/return types | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (final, already breaks if doc not respected) | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#23242 (comment) | License | MIT | Doc PR | n/a Commits ------- 7b1715b078 [Yaml] use scalar type hints where possible 6ce70e4bf9 Add scalar typehints/return types on final/internal/private code
2 parents 804ae1d + 05781ba commit f53f6de

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

Core/Authentication/RememberMe/PersistentToken.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,7 @@ final class PersistentToken implements PersistentTokenInterface
2424
private $tokenValue;
2525
private $lastUsed;
2626

27-
/**
28-
* Constructor.
29-
*
30-
* @param string $class
31-
* @param string $username
32-
* @param string $series
33-
* @param string $tokenValue
34-
* @param \DateTime $lastUsed
35-
*
36-
* @throws \InvalidArgumentException
37-
*/
38-
public function __construct($class, $username, $series, $tokenValue, \DateTime $lastUsed)
27+
public function __construct(string $class, string $username, string $series, string $tokenValue, \DateTime $lastUsed)
3928
{
4029
if (empty($class)) {
4130
throw new \InvalidArgumentException('$class must not be empty.');

Http/Firewall/ExceptionListener.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function onKernelException(GetResponseForExceptionEvent $event)
104104
} while (null !== $exception = $exception->getPrevious());
105105
}
106106

107-
private function handleAuthenticationException(GetResponseForExceptionEvent $event, AuthenticationException $exception)
107+
private function handleAuthenticationException(GetResponseForExceptionEvent $event, AuthenticationException $exception): void
108108
{
109109
if (null !== $this->logger) {
110110
$this->logger->info('An AuthenticationException was thrown; redirecting to authentication entry point.', array('exception' => $exception));
@@ -167,22 +167,14 @@ private function handleAccessDeniedException(GetResponseForExceptionEvent $event
167167
}
168168
}
169169

170-
private function handleLogoutException(LogoutException $exception)
170+
private function handleLogoutException(LogoutException $exception): void
171171
{
172172
if (null !== $this->logger) {
173173
$this->logger->info('A LogoutException was thrown.', array('exception' => $exception));
174174
}
175175
}
176176

177-
/**
178-
* @param Request $request
179-
* @param AuthenticationException $authException
180-
*
181-
* @return Response
182-
*
183-
* @throws AuthenticationException
184-
*/
185-
private function startAuthentication(Request $request, AuthenticationException $authException)
177+
private function startAuthentication(Request $request, AuthenticationException $authException): Response
186178
{
187179
if (null === $this->authenticationEntryPoint) {
188180
throw $authException;
@@ -216,9 +208,6 @@ private function startAuthentication(Request $request, AuthenticationException $
216208
return $response;
217209
}
218210

219-
/**
220-
* @param Request $request
221-
*/
222211
protected function setTargetPath(Request $request)
223212
{
224213
// session isn't required when using HTTP basic authentication mechanism for example

0 commit comments

Comments
 (0)
0