@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public static function configureRoutes(GroupInterface $routes): void |
40 | 40 | { |
41 | - $routes->group(static::GROUP_PREFIX, function (GroupInterface $group) { |
|
41 | + $routes->group(static::GROUP_PREFIX, function(GroupInterface $group) { |
|
42 | 42 | $group->get(static::AUTHORIZE_URI, PassportController::AUTHORIZE_HANDLER); |
43 | 43 | $group->post(static::TOKEN_URI, PassportController::TOKEN_HANDLER); |
44 | 44 | }); |
@@ -272,7 +272,7 @@ |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
275 | - * @param string|int $identifier |
|
275 | + * @param string $identifier |
|
276 | 276 | * @param string $hasManyTableName |
277 | 277 | * @param string $hasManyColumn |
278 | 278 | * @param string $hasManyFkName |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $statement = $query |
163 | 163 | ->select($columns) |
164 | 164 | ->from($this->getTableNameForReading()) |
165 | - ->where($column . '=' . $this->createTypedParameter($query, $identifier)) |
|
165 | + ->where($column.'='.$this->createTypedParameter($query, $identifier)) |
|
166 | 166 | ->execute(); |
167 | 167 | |
168 | 168 | $statement->setFetchMode(PDO::FETCH_CLASS, $this->getClassName()); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | $query |
185 | 185 | ->update($this->getTableNameForWriting()) |
186 | - ->where($this->getPrimaryKeyName() . '=' . $this->createTypedParameter($query, $identifier)); |
|
186 | + ->where($this->getPrimaryKeyName().'='.$this->createTypedParameter($query, $identifier)); |
|
187 | 187 | foreach ($values as $key => $value) { |
188 | 188 | $query->set($key, $this->createTypedParameter($query, $value)); |
189 | 189 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | $query |
207 | 207 | ->delete($this->getTableNameForWriting()) |
208 | - ->where($this->getPrimaryKeyName() . '=' . $this->createTypedParameter($query, $identifier)); |
|
208 | + ->where($this->getPrimaryKeyName().'='.$this->createTypedParameter($query, $identifier)); |
|
209 | 209 | |
210 | 210 | $numberOfDeleted = $query->execute(); |
211 | 211 | assert(is_int($numberOfDeleted) === true); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $query |
263 | 263 | ->select($intForeignKeyName) |
264 | 264 | ->from($intTableName) |
265 | - ->where($intPrimaryKeyName . '=' . $this->createTypedParameter($query, $identifier)); |
|
265 | + ->where($intPrimaryKeyName.'='.$this->createTypedParameter($query, $identifier)); |
|
266 | 266 | |
267 | 267 | $statement = $query->execute(); |
268 | 268 | $statement->setFetchMode(PDO::FETCH_NUM); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $query |
292 | 292 | ->select($hasManyColumn) |
293 | 293 | ->from($hasManyTableName) |
294 | - ->where($hasManyFkName . '=' . $this->createTypedParameter($query, $identifier)); |
|
294 | + ->where($hasManyFkName.'='.$this->createTypedParameter($query, $identifier)); |
|
295 | 295 | |
296 | 296 | $statement = $query->execute(); |
297 | 297 | $statement->setFetchMode(PDO::FETCH_NUM); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | $query |
319 | 319 | ->delete($intTableName) |
320 | - ->where($intPrimaryKeyName . '=' . $this->createTypedParameter($query, $identifier)); |
|
320 | + ->where($intPrimaryKeyName.'='.$this->createTypedParameter($query, $identifier)); |
|
321 | 321 | |
322 | 322 | $numberOfDeleted = $query->execute(); |
323 | 323 | assert(is_int($numberOfDeleted) === true); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | * @param array $parameters |
33 | 33 | * @param string $realm |
34 | 34 | * |
35 | - * @return ClientInterface|null |
|
35 | + * @return \Limoncello\Passport\Contracts\Entities\ClientInterface|null |
|
36 | 36 | * |
37 | 37 | * @SuppressWarnings(PHPMD.ElseExpression) |
38 | 38 | * @SuppressWarnings(PHPMD.NPathComplexity) |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | ServerRequestInterface $request, |
44 | 44 | array $parameters, |
45 | 45 | $realm = 'OAuth' |
46 | - ): ?ClientInterface { |
|
46 | + ): ? ClientInterface { |
|
47 | 47 | // A client may use Basic authentication. |
48 | 48 | // |
49 | 49 | // Or |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // try to parse `Authorization` header for client ID and credentials |
58 | 58 | $clientId = null; |
59 | 59 | $clientCredentials = null; |
60 | - $errorHeaders = ['WWW-Authenticate' => 'Basic realm="' . $realm . '"']; |
|
60 | + $errorHeaders = ['WWW-Authenticate' => 'Basic realm="'.$realm.'"']; |
|
61 | 61 | if (empty($headerArray = $authorizationHeader) === false) { |
62 | 62 | $errorCode = OAuthTokenBodyException::ERROR_INVALID_CLIENT; |
63 | 63 | if (empty($authHeader = $headerArray[0]) === true || |
@@ -63,7 +63,7 @@ discard block |
||
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 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * @inheritdoc |
74 | 74 | */ |
75 | - public function getIdentifier(): ?int |
|
75 | + public function getIdentifier(): ? int |
|
76 | 76 | { |
77 | 77 | return $this->identifierField; |
78 | 78 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * @inheritdoc |
92 | 92 | */ |
93 | - public function getClientIdentifier(): ?string |
|
93 | + public function getClientIdentifier(): ? string |
|
94 | 94 | { |
95 | 95 | return $this->clientIdentifierField; |
96 | 96 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * @inheritdoc |
110 | 110 | */ |
111 | - public function getValue(): ?string |
|
111 | + public function getValue(): ? string |
|
112 | 112 | { |
113 | 113 | return $this->valueField; |
114 | 114 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * @inheritdoc |
50 | 50 | */ |
51 | - public function getCreatedAt(): ?DateTimeInterface |
|
51 | + public function getCreatedAt(): ? DateTimeInterface |
|
52 | 52 | { |
53 | 53 | if ($this->createdAtField === null && |
54 | 54 | $this->hasDynamicProperty(static::FIELD_CREATED_AT) === true && |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | /** |
64 | 64 | * @inheritdoc |
65 | 65 | */ |
66 | - public function getUpdatedAt(): ?DateTimeInterface |
|
66 | + public function getUpdatedAt(): ? DateTimeInterface |
|
67 | 67 | { |
68 | 68 | if ($this->updatedAtField === null && |
69 | 69 | $this->hasDynamicProperty(static::FIELD_UPDATED_AT) === true && |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * @inheritdoc |
57 | 57 | */ |
58 | - public function getIdentifier(): ?string |
|
58 | + public function getIdentifier(): ? string |
|
59 | 59 | { |
60 | 60 | return $this->identifierField; |
61 | 61 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | /** |
74 | 74 | * @inheritdoc |
75 | 75 | */ |
76 | - public function getDescription(): ?string |
|
76 | + public function getDescription(): ? string |
|
77 | 77 | { |
78 | 78 | return $this->descriptionField; |
79 | 79 | } |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | /** |
509 | 509 | * @inheritdoc |
510 | 510 | */ |
511 | - public function getUsersView(): ?string |
|
511 | + public function getUsersView(): ? string |
|
512 | 512 | { |
513 | 513 | return static::VIEW_USERS; |
514 | 514 | } |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | /** |
517 | 517 | * @inheritdoc |
518 | 518 | */ |
519 | - public function getUsersTable(): ?string |
|
519 | + public function getUsersTable(): ? string |
|
520 | 520 | { |
521 | 521 | return $this->usersTableName; |
522 | 522 | } |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | /** |
525 | 525 | * @inheritdoc |
526 | 526 | */ |
527 | - public function getUsersIdentityColumn(): ?string |
|
527 | + public function getUsersIdentityColumn(): ? string |
|
528 | 528 | { |
529 | 529 | return $this->usersIdColumn; |
530 | 530 | } |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | /** |
533 | 533 | * @inheritdoc |
534 | 534 | */ |
535 | - public function getPassportView(): ?string |
|
535 | + public function getPassportView(): ? string |
|
536 | 536 | { |
537 | 537 | return static::VIEW_PASSPORT; |
538 | 538 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | /** |
190 | 190 | * @inheritdoc |
191 | 191 | */ |
192 | - public function getName(): ?string |
|
192 | + public function getName(): ? string |
|
193 | 193 | { |
194 | 194 | return $this->nameField; |
195 | 195 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | /** |
208 | 208 | * @inheritdoc |
209 | 209 | */ |
210 | - public function getDescription(): ?string |
|
210 | + public function getDescription(): ? string |
|
211 | 211 | { |
212 | 212 | return $this->descriptionField; |
213 | 213 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | /** |
226 | 226 | * @inheritdoc |
227 | 227 | */ |
228 | - public function getCredentials(): ?string |
|
228 | + public function getCredentials(): ? string |
|
229 | 229 | { |
230 | 230 | return $this->credentialsField; |
231 | 231 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | ServerRequestInterface $request, |
64 | 64 | array $parameters, |
65 | 65 | $realm = 'OAuth' |
66 | - ): ?ClientInterface; |
|
66 | + ): ? ClientInterface; |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @var PassportServerIntegrationInterface |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | /** |
250 | 250 | * @inheritdoc |
251 | 251 | */ |
252 | - public function codeReadAuthenticationCode(string $code): ?AuthorizationCodeInterface |
|
252 | + public function codeReadAuthenticationCode(string $code): ? AuthorizationCodeInterface |
|
253 | 253 | { |
254 | 254 | return $this->getIntegration()->getTokenRepository() |
255 | 255 | ->readByCode($code, $this->getIntegration()->getCodeExpirationPeriod()); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | |
368 | 368 | assert(is_string($defaultClientId) === true && empty($defaultClientId) === false); |
369 | 369 | |
370 | - $defaultClient = $this->getIntegration()->getClientRepository()->read($defaultClientId); |
|
370 | + $defaultClient = $this->getIntegration()->getClientRepository()->read($defaultClientId); |
|
371 | 371 | |
372 | 372 | assert($defaultClient !== null); |
373 | 373 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | $tokenRepo->updateValues($updatedToken); |
441 | 441 | } else { |
442 | 442 | assert(is_array($scope)); |
443 | - $tokenRepo->inTransaction(function () use ($tokenRepo, $updatedToken, $scope) { |
|
443 | + $tokenRepo->inTransaction(function() use ($tokenRepo, $updatedToken, $scope) { |
|
444 | 444 | $tokenRepo->updateValues($updatedToken); |
445 | 445 | $tokenRepo->unbindScopes($updatedToken->getIdentifier()); |
446 | 446 | $tokenRepo->bindScopeIdentifiers($updatedToken->getIdentifier(), $scope); |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | { |
493 | 493 | $this->logDebug('Sending token as JSON response.'); |
494 | 494 | |
495 | - $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
495 | + $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
496 | 496 | null : $token->getScopeList(); |
497 | 497 | |
498 | 498 | // for access token format @link https://tools.ietf.org/html/rfc6749#section-5.1 |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | ): ResponseInterface { |
557 | 557 | $this->logDebug('Sending token as redirect response.'); |
558 | 558 | |
559 | - $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
559 | + $scopeList = $token->isScopeModified() === false || empty($token->getScopeIdentifiers()) === true ? |
|
560 | 560 | null : $token->getScopeList(); |
561 | 561 | |
562 | 562 | // for access token format @link https://tools.ietf.org/html/rfc6749#section-5.1 |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | */ |
700 | 700 | private function filterNulls(array $array): array |
701 | 701 | { |
702 | - return array_filter($array, function ($value) { |
|
702 | + return array_filter($array, function($value) { |
|
703 | 703 | return $value !== null; |
704 | 704 | }); |
705 | 705 | } |