aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/OAuth2/Bridge/ScopesHelper.php
blob: d075381ef23f24b9f03d82f9e6d53bc41cb47439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

namespace Studip\OAuth2\Bridge;

trait ScopesHelper
{
    public function formatScopes(array $scopes): string
    {
        return json_encode($this->scopesToArray($scopes));
    }

    public function scopesToArray(array $scopes): array
    {
        return array_map(function ($scope) {
            return $scope->getIdentifier();
        }, $scopes);
    }
}