Refix scope

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-05-15 11:41:27 +02:00
parent 991d9b5c3a
commit 4ea2daf04d
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 5 additions and 3 deletions

View File

@ -158,9 +158,11 @@ class DefaultToken extends Entity implements IToken {
return $scope;
}
public function setScope(array $scope = null) {
if ($scope !== null) {
public function setScope($scope) {
if (\is_array($scope)) {
parent::setScope(json_encode($scope));
} else {
parent::setScope((string)$scope);
}
}

View File

@ -94,7 +94,7 @@ interface IToken extends JsonSerializable {
*
* @param array $scope
*/
public function setScope(array $scope = null);
public function setScope($scope);
public function getName(): string;