@@ -38,13 +38,13 @@ |
||
| 38 | 38 | { |
| 39 | 39 | static::baseConfigureContainer($container); |
| 40 | 40 | |
| 41 | - $container[PassportServerIntegrationInterface::class] = function ( |
|
| 41 | + $container[PassportServerIntegrationInterface::class] = function( |
|
| 42 | 42 | PsrContainerInterface $container |
| 43 | 43 | ): PassportServerIntegrationInterface { |
| 44 | 44 | return new PassportServerIntegration($container); |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | - $container[TokenRepositoryInterface::class] = function ( |
|
| 47 | + $container[TokenRepositoryInterface::class] = function( |
|
| 48 | 48 | PsrContainerInterface $container |
| 49 | 49 | ): TokenRepositoryInterface { |
| 50 | 50 | $connection = $container->get(Connection::class); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | /** |
| 155 | 155 | * @inheritdoc |
| 156 | 156 | */ |
| 157 | - public function readPassport(string $tokenValue, int $expirationInSeconds): ?array |
|
| 157 | + public function readPassport(string $tokenValue, int $expirationInSeconds): ? array |
|
| 158 | 158 | { |
| 159 | 159 | $statement = $this->createPassportDataQuery($tokenValue, $expirationInSeconds)->execute(); |
| 160 | 160 | $statement->setFetchMode(PDO::FETCH_ASSOC); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | if ($data !== false) { |
| 164 | 164 | $scheme = $this->getDatabaseScheme(); |
| 165 | 165 | $tokenId = $data[$scheme->getTokensIdentityColumn()]; |
| 166 | - $scopes = $this->readScopeIdentifiers($tokenId); |
|
| 166 | + $scopes = $this->readScopeIdentifiers($tokenId); |
|
| 167 | 167 | $data[$scheme->getTokensViewScopesColumn()] = $scopes; |
| 168 | 168 | $result = $data; |
| 169 | 169 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | { |
| 64 | 64 | if ($this->hasDynamicProperty(static::FIELD_ID) === true) { |
| 65 | 65 | $this |
| 66 | - ->setIdentifier((int)$this->{static::FIELD_ID}) |
|
| 66 | + ->setIdentifier((int) $this->{static::FIELD_ID}) |
|
| 67 | 67 | ->setClientIdentifier($this->{static::FIELD_ID_CLIENT}) |
| 68 | 68 | ->setValue($this->{static::FIELD_VALUE}); |
| 69 | 69 | } |
@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | if ($this->hasDynamicProperty(static::FIELD_ID) === true) { |
| 156 | 156 | $this |
| 157 | - ->setIdentifier((int)$this->{static::FIELD_ID}) |
|
| 157 | + ->setIdentifier((int) $this->{static::FIELD_ID}) |
|
| 158 | 158 | ->setClientIdentifier($this->{static::FIELD_ID_CLIENT}) |
| 159 | - ->setUserIdentifier((int)$this->{static::FIELD_ID_USER}) |
|
| 159 | + ->setUserIdentifier((int) $this->{static::FIELD_ID_USER}) |
|
| 160 | 160 | ->setRedirectUriString($this->{static::FIELD_REDIRECT_URI}) |
| 161 | 161 | ->setCode($this->{static::FIELD_CODE}) |
| 162 | 162 | ->setType($this->{static::FIELD_TYPE}) |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | /** |
| 268 | 268 | * @inheritdoc |
| 269 | 269 | */ |
| 270 | - public function setRedirectUriString(?string $uri): TokenInterface |
|
| 270 | + public function setRedirectUriString(?string $uri) : TokenInterface |
|
| 271 | 271 | { |
| 272 | 272 | $this->redirectUriString = $uri; |
| 273 | 273 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | /** |
| 342 | 342 | * @inheritdoc |
| 343 | 343 | */ |
| 344 | - public function setCode(?string $code): TokenInterface |
|
| 344 | + public function setCode(?string $code) : TokenInterface |
|
| 345 | 345 | { |
| 346 | 346 | $this->codeField = $code; |
| 347 | 347 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | /** |
| 360 | 360 | * @inheritdoc |
| 361 | 361 | */ |
| 362 | - public function setValue(?string $value): TokenInterface |
|
| 362 | + public function setValue(?string $value) : TokenInterface |
|
| 363 | 363 | { |
| 364 | 364 | $this->valueField = $value; |
| 365 | 365 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | /** |
| 378 | 378 | * @inheritdoc |
| 379 | 379 | */ |
| 380 | - public function setType(?string $type): TokenInterface |
|
| 380 | + public function setType(?string $type) : TokenInterface |
|
| 381 | 381 | { |
| 382 | 382 | $this->typeField = $type; |
| 383 | 383 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | /** |
| 396 | 396 | * @inheritdoc |
| 397 | 397 | */ |
| 398 | - public function setRefreshValue(?string $refreshValue): TokenInterface |
|
| 398 | + public function setRefreshValue(?string $refreshValue) : TokenInterface |
|
| 399 | 399 | { |
| 400 | 400 | $this->refreshValueField = $refreshValue; |
| 401 | 401 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @return TokenInterface |
| 74 | 74 | */ |
| 75 | - public function setRedirectUriString(?string $uri): TokenInterface; |
|
| 75 | + public function setRedirectUriString(?string $uri) : TokenInterface; |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * @return TokenInterface |
@@ -104,28 +104,28 @@ discard block |
||
| 104 | 104 | * |
| 105 | 105 | * @return TokenInterface |
| 106 | 106 | */ |
| 107 | - public function setCode(?string $code): TokenInterface; |
|
| 107 | + public function setCode(?string $code) : TokenInterface; |
|
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * @param string|null $value |
| 111 | 111 | * |
| 112 | 112 | * @return TokenInterface |
| 113 | 113 | */ |
| 114 | - public function setValue(?string $value): TokenInterface; |
|
| 114 | + public function setValue(?string $value) : TokenInterface; |
|
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | 117 | * @param string|null $type |
| 118 | 118 | * |
| 119 | 119 | * @return TokenInterface |
| 120 | 120 | */ |
| 121 | - public function setType(?string $type): TokenInterface; |
|
| 121 | + public function setType(?string $type) : TokenInterface; |
|
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | 124 | * @param string|null $refreshValue |
| 125 | 125 | * |
| 126 | 126 | * @return TokenInterface |
| 127 | 127 | */ |
| 128 | - public function setRefreshValue(?string $refreshValue): TokenInterface; |
|
| 128 | + public function setRefreshValue(?string $refreshValue) : TokenInterface; |
|
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * @return DateTimeInterface|null |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | * |
| 131 | 131 | * @return array|null |
| 132 | 132 | */ |
| 133 | - public function readPassport(string $tokenValue, int $expirationInSeconds): ?array; |
|
| 133 | + public function readPassport(string $tokenValue, int $expirationInSeconds): ? array; |
|
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | 136 | * @param TokenInterface $token |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $tokenIdentifier = null; |
| 52 | 52 | if (empty($scopeIdentifiers = $code->getScopeIdentifiers()) === false) { |
| 53 | - $this->inTransaction(function () use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
| 53 | + $this->inTransaction(function() use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
| 54 | 54 | $tokenIdentifier = $this->createResource($values); |
| 55 | 55 | $this->bindScopeIdentifiers($tokenIdentifier, $scopeIdentifiers); |
| 56 | 56 | }); |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | $scheme = $this->getDatabaseScheme(); |
| 77 | 77 | $query |
| 78 | 78 | ->update($this->getTableNameForWriting()) |
| 79 | - ->where($scheme->getTokensCodeColumn() . '=' . $this->createTypedParameter($query, $token->getCode())) |
|
| 79 | + ->where($scheme->getTokensCodeColumn().'='.$this->createTypedParameter($query, $token->getCode())) |
|
| 80 | 80 | ->andWhere( |
| 81 | - $scheme->getTokensCodeCreatedAtColumn() . '>' . $this->createTypedParameter($query, $earliestExpired) |
|
| 81 | + $scheme->getTokensCodeCreatedAtColumn().'>'.$this->createTypedParameter($query, $earliestExpired) |
|
| 82 | 82 | ) |
| 83 | 83 | ->set($scheme->getTokensValueColumn(), $this->createTypedParameter($query, $token->getValue())) |
| 84 | 84 | ->set($scheme->getTokensTypeColumn(), $this->createTypedParameter($query, $token->getType())) |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $tokenIdentifier = null; |
| 128 | 128 | if (empty($scopeIdentifiers = $token->getScopeIdentifiers()) === false) { |
| 129 | - $this->inTransaction(function () use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
| 129 | + $this->inTransaction(function() use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
| 130 | 130 | $tokenIdentifier = $this->createResource($values); |
| 131 | 131 | $this->bindScopeIdentifiers($tokenIdentifier, $scopeIdentifiers); |
| 132 | 132 | }); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $dbNow = $this->createTypedParameter($query, $now); |
| 283 | 283 | $query |
| 284 | 284 | ->update($this->getTableNameForWriting()) |
| 285 | - ->where($this->getPrimaryKeyName() . '=' . $this->createTypedParameter($query, $token->getIdentifier())) |
|
| 285 | + ->where($this->getPrimaryKeyName().'='.$this->createTypedParameter($query, $token->getIdentifier())) |
|
| 286 | 286 | ->set($scheme->getTokensValueColumn(), $this->createTypedParameter($query, $token->getValue())) |
| 287 | 287 | ->set($scheme->getTokensValueCreatedAtColumn(), $dbNow); |
| 288 | 288 | if ($token->getRefreshValue() !== null) { |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $scheme = $this->getDatabaseScheme(); |
| 320 | 320 | $query |
| 321 | 321 | ->update($this->getTableNameForWriting()) |
| 322 | - ->where($this->getPrimaryKeyName() . '=' . $this->createTypedParameter($query, $identifier)) |
|
| 322 | + ->where($this->getPrimaryKeyName().'='.$this->createTypedParameter($query, $identifier)) |
|
| 323 | 323 | ->set($scheme->getTokensIsEnabledColumn(), $this->createTypedParameter($query, false)); |
| 324 | 324 | |
| 325 | 325 | $numberOfUpdated = $query->execute(); |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | $query = $this->addExpirationCondition( |
| 433 | 433 | $query->select($columns) |
| 434 | 434 | ->from($this->getTableNameForReading()) |
| 435 | - ->where($column . '=' . $this->createTypedParameter($query, $identifier)) |
|
| 435 | + ->where($column.'='.$this->createTypedParameter($query, $identifier)) |
|
| 436 | 436 | ->andWhere($query->expr()->eq($this->getDatabaseScheme()->getTokensIsEnabledColumn(), '1')), |
| 437 | 437 | $expirationInSeconds, |
| 438 | 438 | $createdAtColumn |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | string $createdAtColumn |
| 455 | 455 | ): QueryBuilder { |
| 456 | 456 | $earliestExpired = (new DateTimeImmutable())->sub(new DateInterval("PT{$expirationInSeconds}S")); |
| 457 | - $query->andWhere($createdAtColumn . '>' . $this->createTypedParameter($query, $earliestExpired)); |
|
| 457 | + $query->andWhere($createdAtColumn.'>'.$this->createTypedParameter($query, $earliestExpired)); |
|
| 458 | 458 | |
| 459 | 459 | return $query; |
| 460 | 460 | } |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | assert(is_string($defaultClientId) === true && empty($defaultClientId) === false); |
| 370 | 370 | |
| 371 | - $defaultClient = $this->readClientByIdentifier($defaultClientId); |
|
| 371 | + $defaultClient = $this->readClientByIdentifier($defaultClientId); |
|
| 372 | 372 | |
| 373 | 373 | assert($defaultClient !== null); |
| 374 | 374 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | $tokenRepo->updateValues($updatedToken); |
| 442 | 442 | } else { |
| 443 | 443 | assert(is_array($scope)); |
| 444 | - $tokenRepo->inTransaction(function () use ($tokenRepo, $updatedToken, $scope) { |
|
| 444 | + $tokenRepo->inTransaction(function() use ($tokenRepo, $updatedToken, $scope) { |
|
| 445 | 445 | $tokenRepo->updateValues($updatedToken); |
| 446 | 446 | $tokenRepo->unbindScopes($updatedToken->getIdentifier()); |
| 447 | 447 | $tokenRepo->bindScopeIdentifiers($updatedToken->getIdentifier(), $scope); |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | { |
| 502 | 502 | $this->logDebug('Sending token as JSON response.'); |
| 503 | 503 | |
| 504 | - $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
| 504 | + $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
| 505 | 505 | null : $token->getScopeList(); |
| 506 | 506 | |
| 507 | 507 | // for access token format @link https://tools.ietf.org/html/rfc6749#section-5.1 |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | ): ResponseInterface { |
| 566 | 566 | $this->logDebug('Sending token as redirect response.'); |
| 567 | 567 | |
| 568 | - $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
| 568 | + $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
| 569 | 569 | null : $token->getScopeList(); |
| 570 | 570 | |
| 571 | 571 | // for access token format @link https://tools.ietf.org/html/rfc6749#section-5.1 |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | */ |
| 722 | 722 | private function filterNulls(array $array): array |
| 723 | 723 | { |
| 724 | - return array_filter($array, function ($value) { |
|
| 724 | + return array_filter($array, function($value) { |
|
| 725 | 725 | return $value !== null; |
| 726 | 726 | }); |
| 727 | 727 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | [ |
| 133 | 133 | ContainerInterface::class, |
| 134 | 134 | 'int', |
| 135 | - function (ReflectionParameter $parameter) { |
|
| 135 | + function(ReflectionParameter $parameter) { |
|
| 136 | 136 | return $parameter->allowsNull() === true && $parameter->isArray() === true; |
| 137 | 137 | }, |
| 138 | 138 | ] |