| @@ 282-293 (lines=12) @@ | ||
| 279 | /** |
|
| 280 | * @param string|null $refreshToken |
|
| 281 | */ |
|
| 282 | private function setRefreshToken($refreshToken) |
|
| 283 | { |
|
| 284 | if (!is_null($refreshToken)) { |
|
| 285 | self::requireString('refresh_token', $refreshToken); |
|
| 286 | // refresh-token = 1*VSCHAR |
|
| 287 | // VSCHAR = %x20-7E |
|
| 288 | if (1 !== preg_match('/^[\x20-\x7E]+$/', $refreshToken)) { |
|
| 289 | throw new AccessTokenException('invalid "refresh_token"'); |
|
| 290 | } |
|
| 291 | } |
|
| 292 | $this->refreshToken = $refreshToken; |
|
| 293 | } |
|
| 294 | ||
| 295 | /** |
|
| 296 | * @param string|null $scope |
|
| @@ 298-312 (lines=15) @@ | ||
| 295 | /** |
|
| 296 | * @param string|null $scope |
|
| 297 | */ |
|
| 298 | private function setScope($scope) |
|
| 299 | { |
|
| 300 | if (!is_null($scope)) { |
|
| 301 | self::requireString('scope', $scope); |
|
| 302 | // scope = scope-token *( SP scope-token ) |
|
| 303 | // scope-token = 1*NQCHAR |
|
| 304 | // NQCHAR = %x21 / %x23-5B / %x5D-7E |
|
| 305 | foreach (explode(' ', $scope) as $scopeToken) { |
|
| 306 | if (1 !== preg_match('/^[\x21\x23-\x5B\x5D-\x7E]+$/', $scopeToken)) { |
|
| 307 | throw new AccessTokenException('invalid "scope"'); |
|
| 308 | } |
|
| 309 | } |
|
| 310 | } |
|
| 311 | $this->scope = $scope; |
|
| 312 | } |
|
| 313 | ||
| 314 | /** |
|
| 315 | * @param string $k |
|