Completed
Push — master ( 190a84...12722b )
by Neomerx
02:46
created
src/Integration/BasePassportServerIntegration.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         /** @var callable|null $customPropProvider */
128 128
         $customPropProvider = $this->settings[C::KEY_TOKEN_CUSTOM_PROPERTIES_PROVIDER] ?? null;
129 129
         $wrapper            = $customPropProvider !== null ?
130
-            function (TokenInterface $token) use ($container, $customPropProvider): array {
130
+            function(TokenInterface $token) use ($container, $customPropProvider) : array {
131 131
                 return call_user_func($customPropProvider, $container, $token);
132 132
             } : null;
133 133
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public function generateCodeValue(TokenInterface $token): string
178 178
     {
179
-        $codeValue = bin2hex(random_bytes(16)) . uniqid();
179
+        $codeValue = bin2hex(random_bytes(16)).uniqid();
180 180
 
181 181
         assert(is_string($codeValue) === true && empty($codeValue) === false);
182 182
 
@@ -188,10 +188,10 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public function generateTokenValues(TokenInterface $token): array
190 190
     {
191
-        $tokenValue     = bin2hex(random_bytes(16)) . uniqid();
191
+        $tokenValue     = bin2hex(random_bytes(16)).uniqid();
192 192
         $tokenType      = 'bearer';
193 193
         $tokenExpiresIn = $this->getTokenExpirationPeriod();
194
-        $refreshValue   = bin2hex(random_bytes(16)) . uniqid();
194
+        $refreshValue   = bin2hex(random_bytes(16)).uniqid();
195 195
 
196 196
         assert(is_string($tokenValue) === true && empty($tokenValue) === false);
197 197
         assert(is_string($tokenType) === true && empty($tokenType) === false);
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             self::SCOPE_APPROVAL_IS_SCOPE_MODIFIED => $isScopeModified,
261 261
             self::SCOPE_APPROVAL_SCOPE             => $scopeList,
262 262
             self::SCOPE_APPROVAL_STATE             => $state,
263
-        ], function ($value) {
263
+        ], function($value) {
264 264
             return $value !== null;
265 265
         });
266 266
 
Please login to merge, or discard this patch.
src/Entities/Token.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,9 +154,9 @@
 block discarded – undo
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})
Please login to merge, or discard this patch.
src/Adaptors/MySql/TokenRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         $query  = $this->addExpirationCondition(
55 55
             $query->select(['*'])
56 56
                 ->from($schema->getPassportView())
57
-                ->where($schema->getTokensValueColumn() . '=' . $this->createTypedParameter($query, $tokenValue))
57
+                ->where($schema->getTokensValueColumn().'='.$this->createTypedParameter($query, $tokenValue))
58 58
                 ->andWhere($query->expr()->eq($this->getDatabaseSchema()->getTokensIsEnabledColumn(), '1')),
59 59
             $expirationInSeconds,
60 60
             $schema->getTokensValueCreatedAtColumn()
Please login to merge, or discard this patch.
src/Adaptors/Generic/TokenRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
         if ($data !== false) {
164 164
             $schema  = $this->getDatabaseSchema();
165 165
             $tokenId = $data[$schema->getTokensIdentityColumn()];
166
-            $scopes  =  $this->readScopeIdentifiers($tokenId);
166
+            $scopes  = $this->readScopeIdentifiers($tokenId);
167 167
             $data[$schema->getTokensViewScopesColumn()] = $scopes;
168 168
             $result = $data;
169 169
         }
Please login to merge, or discard this patch.
src/Repositories/TokenRepository.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
76 76
         $schema          = $this->getDatabaseSchema();
77 77
         $query
78 78
             ->update($this->getTableNameForWriting())
79
-            ->where($schema->getTokensCodeColumn() . '=' . $this->createTypedParameter($query, $token->getCode()))
79
+            ->where($schema->getTokensCodeColumn().'='.$this->createTypedParameter($query, $token->getCode()))
80 80
             ->andWhere(
81
-                $schema->getTokensCodeCreatedAtColumn() . '>' . $this->createTypedParameter($query, $earliestExpired)
81
+                $schema->getTokensCodeCreatedAtColumn().'>'.$this->createTypedParameter($query, $earliestExpired)
82 82
             )
83 83
             ->set($schema->getTokensValueColumn(), $this->createTypedParameter($query, $token->getValue()))
84 84
             ->set($schema->getTokensTypeColumn(), $this->createTypedParameter($query, $token->getType()))
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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($schema->getTokensValueColumn(), $this->createTypedParameter($query, $token->getValue()))
287 287
             ->set($schema->getTokensValueCreatedAtColumn(), $dbNow);
288 288
         if ($token->getRefreshValue() !== null) {
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
         $schema = $this->getDatabaseSchema();
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($schema->getTokensIsEnabledColumn(), $this->createTypedParameter($query, false));
324 324
 
325 325
         $numberOfUpdated = $query->execute();
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
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->getDatabaseSchema()->getTokensIsEnabledColumn(), '1')),
437 437
             $expirationInSeconds,
438 438
             $createdAtColumn
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Package/BasePassportContainerConfigurator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.