@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | [ |
| 146 | 146 | ContainerInterface::class, |
| 147 | 147 | 'int', |
| 148 | - function (ReflectionParameter $parameter) { |
|
| 148 | + function(ReflectionParameter $parameter) { |
|
| 149 | 149 | return $parameter->allowsNull() === true && $parameter->isArray() === true; |
| 150 | 150 | } |
| 151 | 151 | ] |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | /** |
| 176 | 176 | * @return null|callable (static) |
| 177 | 177 | */ |
| 178 | - protected function getTokenCustomPropertiesProvider(): ?callable |
|
| 178 | + protected function getTokenCustomPropertiesProvider(): ? callable |
|
| 179 | 179 | { |
| 180 | 180 | return null; |
| 181 | 181 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | protected static function baseConfigureContainer(LimoncelloContainerInterface $container): void |
| 44 | 44 | { |
| 45 | 45 | $accountManager = null; |
| 46 | - $factory = function ( |
|
| 46 | + $factory = function( |
|
| 47 | 47 | PsrContainerInterface $container |
| 48 | 48 | ) use (&$accountManager): PassportAccountManagerInterface { |
| 49 | 49 | if ($accountManager === null) { |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $container[AccountManagerInterface::class] = $factory; |
| 56 | 56 | $container[PassportAccountManagerInterface::class] = $factory; |
| 57 | 57 | |
| 58 | - $container[DatabaseSchemeInterface::class] = function ( |
|
| 58 | + $container[DatabaseSchemeInterface::class] = function( |
|
| 59 | 59 | PsrContainerInterface $container |
| 60 | 60 | ): DatabaseSchemeInterface { |
| 61 | 61 | $settings = $container->get(SettingsProviderInterface::class)->get(C::class); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | return new DatabaseScheme($settings[C::KEY_USER_TABLE_NAME], $settings[C::KEY_USER_PRIMARY_KEY_NAME]); |
| 64 | 64 | }; |
| 65 | 65 | |
| 66 | - $container[PassportServerInterface::class] = function ( |
|
| 66 | + $container[PassportServerInterface::class] = function( |
|
| 67 | 67 | PsrContainerInterface $container |
| 68 | 68 | ): PassportServerInterface { |
| 69 | 69 | $integration = $container->get(PassportServerIntegrationInterface::class); |
@@ -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); |
@@ -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 | }); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | /** |
| 191 | 191 | * @inheritdoc |
| 192 | 192 | */ |
| 193 | - public function read(int $identifier): ?TokenInterface |
|
| 193 | + public function read(int $identifier): ? TokenInterface |
|
| 194 | 194 | { |
| 195 | 195 | return $this->readResource($identifier); |
| 196 | 196 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | /** |
| 199 | 199 | * @inheritdoc |
| 200 | 200 | */ |
| 201 | - public function readByCode(string $code, int $expirationInSeconds): ?TokenInterface |
|
| 201 | + public function readByCode(string $code, int $expirationInSeconds): ? TokenInterface |
|
| 202 | 202 | { |
| 203 | 203 | $scheme = $this->getDatabaseScheme(); |
| 204 | 204 | return $this->readEnabledTokenByColumnWithExpirationCheck( |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | /** |
| 213 | 213 | * @inheritdoc |
| 214 | 214 | */ |
| 215 | - public function readByValue(string $tokenValue, int $expirationInSeconds): ?TokenInterface |
|
| 215 | + public function readByValue(string $tokenValue, int $expirationInSeconds): ? TokenInterface |
|
| 216 | 216 | { |
| 217 | 217 | $scheme = $this->getDatabaseScheme(); |
| 218 | 218 | return $this->readEnabledTokenByColumnWithExpirationCheck( |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * @inheritdoc |
| 228 | 228 | */ |
| 229 | - public function readByRefresh(string $refreshValue, int $expirationInSeconds): ?TokenInterface |
|
| 229 | + public function readByRefresh(string $refreshValue, int $expirationInSeconds): ? TokenInterface |
|
| 230 | 230 | { |
| 231 | 231 | $scheme = $this->getDatabaseScheme(); |
| 232 | 232 | return $this->readEnabledTokenByColumnWithExpirationCheck( |
@@ -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(); |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | int $expirationInSeconds, |
| 358 | 358 | string $createdAtColumn, |
| 359 | 359 | array $columns = ['*'] |
| 360 | - ): ?TokenInterface { |
|
| 360 | + ): ? TokenInterface { |
|
| 361 | 361 | $query = $this->createEnabledTokenByColumnWithExpirationCheckQuery( |
| 362 | 362 | $identifier, |
| 363 | 363 | $column, |
@@ -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 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | if (empty($scopeIdentifiers = $client->getScopeIdentifiers()) === true) { |
| 64 | 64 | $this->createResource($values); |
| 65 | 65 | } else { |
| 66 | - $this->inTransaction(function () use ($identifier, $values, $scopeIdentifiers) { |
|
| 66 | + $this->inTransaction(function() use ($identifier, $values, $scopeIdentifiers) { |
|
| 67 | 67 | $this->createResource($values); |
| 68 | 68 | $this->bindScopeIdentifiers($identifier, $scopeIdentifiers); |
| 69 | 69 | }); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | /** |
| 125 | 125 | * @inheritdoc |
| 126 | 126 | */ |
| 127 | - public function read(string $identifier): ?ClientInterface |
|
| 127 | + public function read(string $identifier): ? ClientInterface |
|
| 128 | 128 | { |
| 129 | 129 | return $this->readResource($identifier); |
| 130 | 130 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $statement = $query |
| 38 | 38 | ->select(['*']) |
| 39 | 39 | ->from($this->getTableNameForWriting()) |
| 40 | - ->where($clientIdColumn . '=' . $this->createTypedParameter($query, $clientIdentifier)) |
|
| 40 | + ->where($clientIdColumn.'='.$this->createTypedParameter($query, $clientIdentifier)) |
|
| 41 | 41 | ->execute(); |
| 42 | 42 | |
| 43 | 43 | $statement->setFetchMode(PDO::FETCH_CLASS, $this->getClassName()); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * @inheritdoc |
| 55 | 55 | */ |
| 56 | - public function getAccount(): ?AccountInterface |
|
| 56 | + public function getAccount(): ? AccountInterface |
|
| 57 | 57 | { |
| 58 | 58 | return $this->getPassport(); |
| 59 | 59 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * @inheritdoc |
| 63 | 63 | */ |
| 64 | - public function getPassport(): ?PassportAccountInterface |
|
| 64 | + public function getPassport(): ? PassportAccountInterface |
|
| 65 | 65 | { |
| 66 | 66 | return $this->account; |
| 67 | 67 | } |
@@ -47,14 +47,14 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * @inheritdoc |
| 49 | 49 | */ |
| 50 | - public function readPassport(string $tokenValue, int $expirationInSeconds): ?array |
|
| 50 | + public function readPassport(string $tokenValue, int $expirationInSeconds): ? array |
|
| 51 | 51 | { |
| 52 | 52 | $scheme = $this->getDatabaseScheme(); |
| 53 | 53 | $query = $this->getConnection()->createQueryBuilder(); |
| 54 | 54 | $query = $this->addExpirationCondition( |
| 55 | 55 | $query->select(['*']) |
| 56 | 56 | ->from($scheme->getPassportView()) |
| 57 | - ->where($scheme->getTokensValueColumn() . '=' . $this->createTypedParameter($query, $tokenValue)) |
|
| 57 | + ->where($scheme->getTokensValueColumn().'='.$this->createTypedParameter($query, $tokenValue)) |
|
| 58 | 58 | ->andWhere($query->expr()->eq($this->getDatabaseScheme()->getTokensIsEnabledColumn(), '1')), |
| 59 | 59 | $expirationInSeconds, |
| 60 | 60 | $scheme->getTokensValueCreatedAtColumn() |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * @inheritdoc |
| 51 | 51 | */ |
| 52 | - public function read(int $identifier): ?TokenInterface |
|
| 52 | + public function read(int $identifier): ? TokenInterface |
|
| 53 | 53 | { |
| 54 | 54 | $token = parent::read($identifier); |
| 55 | 55 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | /** |
| 64 | 64 | * @inheritdoc |
| 65 | 65 | */ |
| 66 | - public function readByCode(string $code, int $expirationInSeconds): ?TokenInterface |
|
| 66 | + public function readByCode(string $code, int $expirationInSeconds): ? TokenInterface |
|
| 67 | 67 | { |
| 68 | 68 | $token = parent::readByCode($code, $expirationInSeconds); |
| 69 | 69 | if ($token !== null) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * @inheritdoc |
| 78 | 78 | */ |
| 79 | - public function readByValue(string $tokenValue, int $expirationInSeconds): ?TokenInterface |
|
| 79 | + public function readByValue(string $tokenValue, int $expirationInSeconds): ? TokenInterface |
|
| 80 | 80 | { |
| 81 | 81 | $token = parent::readByValue($tokenValue, $expirationInSeconds); |
| 82 | 82 | if ($token !== null) { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | /** |
| 90 | 90 | * @inheritdoc |
| 91 | 91 | */ |
| 92 | - public function readByRefresh(string $refreshValue, int $expirationInSeconds): ?TokenInterface |
|
| 92 | + public function readByRefresh(string $refreshValue, int $expirationInSeconds): ? TokenInterface |
|
| 93 | 93 | { |
| 94 | 94 | $token = parent::readByRefresh($refreshValue, $expirationInSeconds); |
| 95 | 95 | if ($token !== null) { |
@@ -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 | } |