/**
  * Validate the scopes.
  *
  * @param $scopes
  *
  * @throws \League\OAuth2\Server\Exception\InvalidScopeException
  */
 public function validateScopes($scopes)
 {
     if (!empty($scopes) && !$this->authorizer->hasScope($scopes)) {
         throw new InvalidScopeException(implode(',', $scopes));
     }
 }