@@ -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) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $container[AccountManagerInterface::class] = $factory; |
59 | 59 | $container[PassportAccountManagerInterface::class] = $factory; |
60 | 60 | |
61 | - $container[DatabaseSchemaInterface::class] = function ( |
|
61 | + $container[DatabaseSchemaInterface::class] = function( |
|
62 | 62 | PsrContainerInterface $container |
63 | 63 | ): DatabaseSchemaInterface { |
64 | 64 | $settings = $container->get(SettingsProviderInterface::class)->get(C::class); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | return new DatabaseSchema($settings[C::KEY_USER_TABLE_NAME], $settings[C::KEY_USER_PRIMARY_KEY_NAME]); |
67 | 67 | }; |
68 | 68 | |
69 | - $container[PassportServerInterface::class] = function ( |
|
69 | + $container[PassportServerInterface::class] = function( |
|
70 | 70 | PsrContainerInterface $container |
71 | 71 | ): PassportServerInterface { |
72 | 72 | $integration = $container->get(PassportServerIntegrationInterface::class); |
@@ -478,7 +478,7 @@ |
||
478 | 478 | * @param string $column |
479 | 479 | * @param int $expirationInSeconds |
480 | 480 | * @param string $createdAtColumn |
481 | - * @param array $columns |
|
481 | + * @param string[] $columns |
|
482 | 482 | * @param int|null $limit |
483 | 483 | * |
484 | 484 | * @return array |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function createCode(TokenInterface $code): TokenInterface |
44 | 44 | { |
45 | 45 | try { |
46 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
46 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
47 | 47 | return new DateTimeImmutable(); |
48 | 48 | }); |
49 | 49 | $schema = $this->getDatabaseSchema(); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | $tokenIdentifier = null; |
59 | 59 | if (empty($scopeIdentifiers = $code->getScopeIdentifiers()) === false) { |
60 | - $this->inTransaction(function () use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
60 | + $this->inTransaction(function() use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
61 | 61 | $this->createResource($values); |
62 | 62 | $tokenIdentifier = $this->getLastInsertId(); |
63 | 63 | $this->bindScopeIdentifiers($tokenIdentifier, $scopeIdentifiers); |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | try { |
87 | 87 | $query = $this->getConnection()->createQueryBuilder(); |
88 | 88 | |
89 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
89 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
90 | 90 | return new DateTimeImmutable(); |
91 | 91 | }); |
92 | 92 | $dbNow = $this->createTypedParameter($query, $now); |
93 | 93 | |
94 | - $earliestExpired = $this->ignoreException(function () use ($now, $expirationInSeconds) : DateTimeImmutable { |
|
94 | + $earliestExpired = $this->ignoreException(function() use ($now, $expirationInSeconds) : DateTimeImmutable { |
|
95 | 95 | /** @var DateTimeImmutable $now */ |
96 | 96 | return $now->sub(new DateInterval("PT{$expirationInSeconds}S")); |
97 | 97 | }); |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | $schema = $this->getDatabaseSchema(); |
100 | 100 | $query |
101 | 101 | ->update($this->getTableNameForWriting()) |
102 | - ->where($schema->getTokensCodeColumn() . '=' . $this->createTypedParameter($query, $token->getCode())) |
|
102 | + ->where($schema->getTokensCodeColumn().'='.$this->createTypedParameter($query, $token->getCode())) |
|
103 | 103 | ->andWhere( |
104 | - $schema->getTokensCodeCreatedAtColumn() . '>' . |
|
104 | + $schema->getTokensCodeCreatedAtColumn().'>'. |
|
105 | 105 | $this->createTypedParameter($query, $earliestExpired) |
106 | 106 | ) |
107 | 107 | ->set($schema->getTokensValueColumn(), $this->createTypedParameter($query, $token->getValue())) |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | public function createToken(TokenInterface $token): TokenInterface |
135 | 135 | { |
136 | 136 | try { |
137 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
137 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
138 | 138 | return new DateTimeImmutable(); |
139 | 139 | }); |
140 | 140 | $schema = $this->getDatabaseSchema(); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | $tokenIdentifier = null; |
163 | 163 | if (empty($scopeIdentifiers = $token->getScopeIdentifiers()) === false) { |
164 | - $this->inTransaction(function () use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
164 | + $this->inTransaction(function() use ($values, $scopeIdentifiers, &$tokenIdentifier) { |
|
165 | 165 | $this->createResource($values); |
166 | 166 | $tokenIdentifier = $this->getLastInsertId(); |
167 | 167 | $this->bindScopeIdentifiers($tokenIdentifier, $scopeIdentifiers); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function bindScopes(int $identifier, iterable $scopes): void |
192 | 192 | { |
193 | - $getIdentifiers = function (iterable $scopes): iterable { |
|
193 | + $getIdentifiers = function(iterable $scopes): iterable { |
|
194 | 194 | foreach ($scopes as $scope) { |
195 | 195 | /** @var ScopeInterface $scope */ |
196 | 196 | assert($scope instanceof ScopeInterface); |
@@ -359,13 +359,13 @@ discard block |
||
359 | 359 | $query = $this->getConnection()->createQueryBuilder(); |
360 | 360 | |
361 | 361 | $schema = $this->getDatabaseSchema(); |
362 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
362 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
363 | 363 | return new DateTimeImmutable(); |
364 | 364 | }); |
365 | 365 | $dbNow = $this->createTypedParameter($query, $now); |
366 | 366 | $query |
367 | 367 | ->update($this->getTableNameForWriting()) |
368 | - ->where($this->getPrimaryKeyName() . '=' . $this->createTypedParameter($query, $token->getIdentifier())) |
|
368 | + ->where($this->getPrimaryKeyName().'='.$this->createTypedParameter($query, $token->getIdentifier())) |
|
369 | 369 | ->set($schema->getTokensValueColumn(), $this->createTypedParameter($query, $token->getValue())) |
370 | 370 | ->set($schema->getTokensValueCreatedAtColumn(), $dbNow); |
371 | 371 | if ($token->getRefreshValue() !== null) { |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $schema = $this->getDatabaseSchema(); |
413 | 413 | $query |
414 | 414 | ->update($this->getTableNameForWriting()) |
415 | - ->where($this->getPrimaryKeyName() . '=' . $this->createTypedParameter($query, $identifier)) |
|
415 | + ->where($this->getPrimaryKeyName().'='.$this->createTypedParameter($query, $identifier)) |
|
416 | 416 | ->set($schema->getTokensIsEnabledColumn(), $this->createTypedParameter($query, false)); |
417 | 417 | |
418 | 418 | $numberOfUpdated = $query->execute(); |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | $query = $this->addExpirationCondition( |
540 | 540 | $query->select($columns) |
541 | 541 | ->from($this->getTableNameForReading()) |
542 | - ->where($column . '=' . $this->createTypedParameter($query, $identifier)) |
|
542 | + ->where($column.'='.$this->createTypedParameter($query, $identifier)) |
|
543 | 543 | // SQLite and MySQL work fine with just 1 but PostgreSQL wants it to be a string '1' |
544 | 544 | ->andWhere($query->expr()->eq($this->getDatabaseSchema()->getTokensIsEnabledColumn(), "'1'")), |
545 | 545 | $expirationInSeconds, |
@@ -561,11 +561,11 @@ discard block |
||
561 | 561 | int $expirationInSeconds, |
562 | 562 | string $createdAtColumn |
563 | 563 | ): QueryBuilder { |
564 | - $earliestExpired = $this->ignoreException(function () use ($expirationInSeconds) : DateTimeImmutable { |
|
564 | + $earliestExpired = $this->ignoreException(function() use ($expirationInSeconds) : DateTimeImmutable { |
|
565 | 565 | return (new DateTimeImmutable())->sub(new DateInterval("PT{$expirationInSeconds}S")); |
566 | 566 | }); |
567 | 567 | |
568 | - $query->andWhere($createdAtColumn . '>' . $this->createTypedParameter($query, $earliestExpired)); |
|
568 | + $query->andWhere($createdAtColumn.'>'.$this->createTypedParameter($query, $earliestExpired)); |
|
569 | 569 | |
570 | 570 | return $query; |
571 | 571 | } |
@@ -150,8 +150,7 @@ |
||
150 | 150 | |
151 | 151 | $curScopes[] = $scopeId; |
152 | 152 | } |
153 | - $curTokenId === null || empty($curScopes) === true ?: |
|
154 | - $tokens[$curTokenId]->setScopeIdentifiers($curScopes); |
|
153 | + $curTokenId === null || empty($curScopes) === true ?: $tokens[$curTokenId]->setScopeIdentifiers($curScopes); |
|
155 | 154 | } |
156 | 155 | |
157 | 156 | return $tokens; |
@@ -30,8 +30,8 @@ |
||
30 | 30 | use ArrayParserTrait; |
31 | 31 | |
32 | 32 | /** |
33 | - * @var string |
|
34 | - */ |
|
33 | + * @var string |
|
34 | + */ |
|
35 | 35 | private $modelClass; |
36 | 36 | |
37 | 37 | /** |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $query = $this->addExpirationCondition( |
62 | 62 | $query->select(['*']) |
63 | 63 | ->from($schema->getPassportView()) |
64 | - ->where($schema->getTokensValueColumn() . '=' . $this->createTypedParameter($query, $tokenValue)) |
|
64 | + ->where($schema->getTokensValueColumn().'='.$this->createTypedParameter($query, $tokenValue)) |
|
65 | 65 | ->andWhere($query->expr()->eq($this->getDatabaseSchema()->getTokensIsEnabledColumn(), "'1'")), |
66 | 66 | $expirationInSeconds, |
67 | 67 | $schema->getTokensValueCreatedAtColumn() |
@@ -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); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $statement = $query |
43 | 43 | ->select(['*']) |
44 | 44 | ->from($this->getTableNameForWriting()) |
45 | - ->where($clientIdColumn . '=' . $this->createTypedParameter($query, $clientIdentifier)) |
|
45 | + ->where($clientIdColumn.'='.$this->createTypedParameter($query, $clientIdentifier)) |
|
46 | 46 | ->execute(); |
47 | 47 | |
48 | 48 | $statement->setFetchMode(PDO::FETCH_CLASS, $this->getClassName()); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function create(RedirectUriInterface $redirectUri): RedirectUriInterface |
64 | 64 | { |
65 | 65 | try { |
66 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
66 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
67 | 67 | return new DateTimeImmutable(); |
68 | 68 | }); |
69 | 69 | $schema = $this->getDatabaseSchema(); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function update(RedirectUriInterface $redirectUri): void |
107 | 107 | { |
108 | 108 | try { |
109 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
109 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
110 | 110 | return new DateTimeImmutable(); |
111 | 111 | }); |
112 | 112 | $schema = $this->getDatabaseSchema(); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function create(ScopeInterface $scope): ScopeInterface |
50 | 50 | { |
51 | 51 | try { |
52 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
52 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
53 | 53 | return new DateTimeImmutable(); |
54 | 54 | }); |
55 | 55 | $schema = $this->getDatabaseSchema(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public function update(ScopeInterface $scope): void |
92 | 92 | { |
93 | 93 | try { |
94 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
94 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
95 | 95 | return new DateTimeImmutable(); |
96 | 96 | }); |
97 | 97 | $schema = $this->getDatabaseSchema(); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function create(ClientInterface $client): ClientInterface |
46 | 46 | { |
47 | 47 | try { |
48 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
48 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
49 | 49 | return new DateTimeImmutable(); |
50 | 50 | }); |
51 | 51 | $schema = $this->getDatabaseSchema(); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if (empty($scopeIdentifiers = $client->getScopeIdentifiers()) === true) { |
70 | 70 | $this->createResource($values); |
71 | 71 | } else { |
72 | - $this->inTransaction(function () use ($identifier, $values, $scopeIdentifiers) { |
|
72 | + $this->inTransaction(function() use ($identifier, $values, $scopeIdentifiers) { |
|
73 | 73 | $this->createResource($values); |
74 | 74 | $this->bindScopeIdentifiers($identifier, $scopeIdentifiers); |
75 | 75 | }); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function bindScopes(string $identifier, iterable $scopes): void |
92 | 92 | { |
93 | - $getIdentifiers = function (iterable $scopes): iterable { |
|
93 | + $getIdentifiers = function(iterable $scopes): iterable { |
|
94 | 94 | foreach ($scopes as $scope) { |
95 | 95 | /** @var ScopeInterface $scope */ |
96 | 96 | assert($scope instanceof ScopeInterface); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | public function update(ClientInterface $client): void |
210 | 210 | { |
211 | 211 | try { |
212 | - $now = $this->ignoreException(function (): DateTimeImmutable { |
|
212 | + $now = $this->ignoreException(function(): DateTimeImmutable { |
|
213 | 213 | return new DateTimeImmutable(); |
214 | 214 | }); |
215 | 215 | $schema = $this->getDatabaseSchema(); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $query = $this->addExpirationCondition( |
62 | 62 | $query->select(['*']) |
63 | 63 | ->from($schema->getPassportView()) |
64 | - ->where($schema->getTokensValueColumn() . '=' . $this->createTypedParameter($query, $tokenValue)) |
|
64 | + ->where($schema->getTokensValueColumn().'='.$this->createTypedParameter($query, $tokenValue)) |
|
65 | 65 | ->andWhere($query->expr()->eq($this->getDatabaseSchema()->getTokensIsEnabledColumn(), "'1'")), |
66 | 66 | $expirationInSeconds, |
67 | 67 | $schema->getTokensValueCreatedAtColumn() |