Skip to content

Commit

Permalink
minor #24316 Added null as explicit return type (?TokenInterface) (il…
Browse files Browse the repository at this point in the history
…tar)

This PR was merged into the 2.7 branch.

Discussion
----------

Added null as explicit return type (?TokenInterface)

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23882 (comment)
| License       | MIT
| Doc PR        | ~

This fixes the returntype in the `ContextListener` so it can be merged upwards.

/cc @chalasr

Commits
-------

1ba4dd9 Added null as explicit return type (?TokenInterface)
  • Loading branch information
nicolas-grekas committed Sep 26, 2017
2 parents 3128cfd + 1ba4dd9 commit b90ce05
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -174,7 +174,7 @@ protected function refreshUser(TokenInterface $token)
}

if ($userNotFoundByProvider) {
return;
return null;
}

throw new \RuntimeException(sprintf('There is no user provider for user "%s".', get_class($user)));
Expand Down

0 comments on commit b90ce05

Please sign in to comment.