protected function getBearerTokenFromQuery(Request $request, $removeFromRequest)
{
if (!($token = $request->query->get(self::TOKEN_PARAM_NAME))) {
return null;
}
if ($removeFromRequest) {
$request->query->remove(self::TOKEN_PARAM_NAME);
}
return $token;
}