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