original_string: protected function validateTokenScopes(array $scopes)
      {
          $scopes = array_map(function ($scope) {
              return (string) $scope;
          }, $scopes);
  
          $registeredScopes = $this->scopeService->getAll();
  
          $registeredScopes = array_map(function ($scope) {
              return (string) $scope;
          }, $registeredScopes);
  
          $diff = array_diff($scopes, $registeredScopes);
  
          if (count($diff) > 0) {
              throw OAuth2Exception::invalidScope(sprintf(
                  'Some scope(s) do not exist: %s',
                  implode(', ', $diff)
              ));
          }
      }
code: protected function validateTokenScopes(array $scopes)
      {
          $scopes = array_map(function ($scope) {
              return (string) $scope;
          }, $scopes);
  
          $registeredScopes = $this->scopeService->getAll();
  
          $registeredScopes = array_map(function ($scope) {
              return (string) $scope;
          }, $registeredScopes);
  
          $diff = array_diff($scopes, $registeredScopes);
  
          if (count($diff) > 0) {
              throw OAuth2Exception::invalidScope(sprintf(
                  'Some scope(s) do not exist: %s',
                  implode(', ', $diff)
              ));
          }
      }
code_tokens: protected function validateTokenScopes ( array $ scopes ) { $ scopes = array_map ( function ( $ scope ) { return ( string ) $ scope ; } , $ scopes ) ; $ registeredScopes = $ this -> scopeService -> getAll ( ) ; $ registeredScopes = array_map ( function ( $ scope ) { return ( string ) $ scope ; } , $ registeredScopes ) ; $ diff = array_diff ( $ scopes , $ registeredScopes ) ; if ( count ( $ diff ) > 0 ) { throw OAuth2Exception :: invalidScope ( sprintf ( 'Some scope(s) do not exist: %s' , implode ( ', ' , $ diff ) ) ) ; } }
docstring: Validate the token scopes against the registered scope
  
  @param string[]|Scope[] $scopes
  
  @throws OAuth2Exception (invalid_scope) When one or more of the given scopes where not registered
docstring_tokens: Validate the token scopes against the registered scope