| @@ 312-323 (lines=12) @@ | ||
| 309 | /** |
|
| 310 | * @param string|null $refreshToken |
|
| 311 | */ |
|
| 312 | private function setRefreshToken($refreshToken) |
|
| 313 | { |
|
| 314 | if (!is_null($refreshToken)) { |
|
| 315 | self::requireString('refresh_token', $refreshToken); |
|
| 316 | // refresh-token = 1*VSCHAR |
|
| 317 | // VSCHAR = %x20-7E |
|
| 318 | if (1 !== preg_match('/^[\x20-\x7E]+$/', $refreshToken)) { |
|
| 319 | throw new AccessTokenException('invalid "refresh_token"'); |
|
| 320 | } |
|
| 321 | } |
|
| 322 | $this->refreshToken = $refreshToken; |
|
| 323 | } |
|
| 324 | ||
| 325 | /** |
|
| 326 | * @param string|null $scope |
|
| @@ 328-342 (lines=15) @@ | ||
| 325 | /** |
|
| 326 | * @param string|null $scope |
|
| 327 | */ |
|
| 328 | private function setScope($scope) |
|
| 329 | { |
|
| 330 | if (!is_null($scope)) { |
|
| 331 | self::requireString('scope', $scope); |
|
| 332 | // scope = scope-token *( SP scope-token ) |
|
| 333 | // scope-token = 1*NQCHAR |
|
| 334 | // NQCHAR = %x21 / %x23-5B / %x5D-7E |
|
| 335 | foreach (explode(' ', $scope) as $scopeToken) { |
|
| 336 | if (1 !== preg_match('/^[\x21\x23-\x5B\x5D-\x7E]+$/', $scopeToken)) { |
|
| 337 | throw new AccessTokenException('invalid "scope"'); |
|
| 338 | } |
|
| 339 | } |
|
| 340 | } |
|
| 341 | $this->scope = $scope; |
|
| 342 | } |
|
| 343 | ||
| 344 | /** |
|
| 345 | * @param string $k |
|