Skip to content

Commit 6358f47

Browse files
author
Iltar van der Berg
committed
Added instanceof check in example
1 parent f7482c0 commit 6358f47

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cookbook/controller/argument_value_resolver.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ the current security token. This token can be retrieved from the token storage.:
110110
}
111111

112112
$token = $this->tokenStorage->getToken();
113+
114+
if (!$token instanceof TokenInterface) {
115+
return false;
116+
}
117+
113118
return $token->getUser() instanceof User;
114119
}
115120

0 commit comments

Comments
 (0)