private function formatScopes(array $scopes)
    {
        if (empty($scopes)) {
            return [null]; //use at least 1 null scope
        }

        array_walk(
            $scopes,
            function (&$scope) {
                if (is_array($scope)) {
                    $scope = implode(' ', $scope);
                }
            }
        );

        return $scopes;
    }
private function formatScopes(array $scopes)
    {
        if (empty($scopes)) {
            return [null]; //use at least 1 null scope
        }

        array_walk(
            $scopes,
            function (&$scope) {
                if (is_array($scope)) {
                    $scope = implode(' ', $scope);
                }
            }
        );

        return $scopes;
    }
private function formatScopes ( array $ scopes ) { if ( empty ( $ scopes ) ) { return [ null ] ; //use at least 1 null scope } array_walk ( $ scopes , function ( & $ scope ) { if ( is_array ( $ scope ) ) { $ scope = implode ( ' ' , $ scope ) ; } } ) ; return $ scopes ; }
Helper method to ensure given scopes are formatted properly.

@param array $scopes Scopes required for authorization.

@return array The formatted scopes array.
Helper method to ensure given scopes are formatted properly .