src/Grant/AbstractGrant.php
public function validateScopes($scopes, $redirectUri = null)
    {
        if (!\is_array($scopes)) {
            $scopes = $this->convertScopesQueryStringToArray($scopes);
        }

        $validScopes = [];

        foreach ($scopes as $scopeItem) {
            $scope = $this->scopeRepository->getScopeEntityByIdentifier($scopeItem);

            if ($scope instanceof ScopeEntityInterface === false) {
                throw OAuthServerException::invalidScope($scopeItem, $redirectUri);
            }

            $validScopes[] = $scope;
        }

        return $validScopes;
    }
public function validateScopes($scopes, $redirectUri = null)
    {
        if (!\is_array($scopes)) {
            $scopes = $this->convertScopesQueryStringToArray($scopes);
        }

        $validScopes = [];

        foreach ($scopes as $scopeItem) {
            $scope = $this->scopeRepository->getScopeEntityByIdentifier($scopeItem);

            if ($scope instanceof ScopeEntityInterface === false) {
                throw OAuthServerException::invalidScope($scopeItem, $redirectUri);
            }

            $validScopes[] = $scope;
        }

        return $validScopes;
    }
public function validateScopes ( $ scopes , $ redirectUri = null ) { if ( ! \ is_array ( $ scopes ) ) { $ scopes = $ this -> convertScopesQueryStringToArray ( $ scopes ) ; } $ validScopes = [ ] ; foreach ( $ scopes as $ scopeItem ) { $ scope = $ this -> scopeRepository -> getScopeEntityByIdentifier ( $ scopeItem ) ; if ( $ scope instanceof ScopeEntityInterface === false ) { throw OAuthServerException :: invalidScope ( $ scopeItem , $ redirectUri ) ; } $ validScopes [ ] = $ scope ; } return $ validScopes ; }
Validate scopes in the request.

@param string|array $scopes
@param string       $redirectUri

@throws OAuthServerException

@return ScopeEntityInterface[]
Validate scopes in the request .