Passed
Pull Request — master (#1682)
by Al
63:56
created
src/Security/SecurityUser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Security/SecurityUser.php
5 5
  *
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 class SecurityUser implements UserInterface, PasswordAuthenticatedUserInterface
22 22
 {
23 23
     private string $identifier;
24
-    private string | null $password;
24
+    private string|null $password;
25 25
     private string $language;
26 26
     private string $locale;
27 27
     private string $timezone;
Please login to merge, or discard this patch.
src/EventSubscriber/LockedUserSubscriber.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/EventSubscriber/LockedUserSubscriber.php
5 5
  *
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
     /**
94 94
      * @throws Throwable
95 95
      */
96
-    private function getUser(string | object $user): ?User
96
+    private function getUser(string|object $user): ?User
97 97
     {
98
-        return match (true) {
98
+        return match(true) {
99 99
             is_string($user) => $this->userRepository->loadUserByIdentifier($user, false),
100 100
             $user instanceof SecurityUser =>
101 101
                 $this->userRepository->loadUserByIdentifier($user->getUserIdentifier(), true),
Please login to merge, or discard this patch.
src/Rest/Interfaces/SearchTermInterface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Rest/Interfaces/SearchTermInterface.php
5 5
  *
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
      * @return array<string, array<string, array<string, string>>>|null
39 39
      */
40 40
     public static function getCriteria(
41
-        array | string $column,
42
-        array | string $search,
41
+        array|string $column,
42
+        array|string $search,
43 43
         ?string $operand = null,
44 44
         ?int $mode = null,
45 45
     ): ?array;
Please login to merge, or discard this patch.
src/Command/Utils/CheckDependencies.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Command/Utils/CheckDependencies.php
5 5
  *
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
          */
87 87
         $packageNameLength = (int)max(
88 88
             array_map(
89
-                static fn (array $row): int => isset($row[1]) ? strlen($row[1]) : 0,
90
-                array_filter($rows, static fn (mixed $row): bool => !$row instanceof TableSeparator)
89
+                static fn(array $row): int => isset($row[1]) ? strlen($row[1]) : 0,
90
+                array_filter($rows, static fn(mixed $row) : bool => !$row instanceof TableSeparator)
91 91
             ) + [0]
92 92
         );
93 93
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             ->directories()
129 129
             ->in($this->projectDir . DIRECTORY_SEPARATOR . 'tools/');
130 130
 
131
-        $closure = static fn (SplFileInfo $fileInfo): string => $fileInfo->getPath();
131
+        $closure = static fn(SplFileInfo $fileInfo): string => $fileInfo->getPath();
132 132
 
133 133
         /** @var Traversable<SplFileInfo> $iterator */
134 134
         $iterator = $finder->getIterator();
Please login to merge, or discard this patch.
src/Utils/JSON.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Utils/JSON.php
5 5
  *
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $options ??= 0;
41 41
         $depth ??= 512;
42 42
 
43
-        return json_encode($input, JSON_THROW_ON_ERROR | $options, $depth);
43
+        return json_encode($input, JSON_THROW_ON_ERROR|$options, $depth);
44 44
     }
45 45
 
46 46
     /**
@@ -63,6 +63,6 @@  discard block
 block discarded – undo
63 63
         $depth ??= 512;
64 64
         $options ??= 0;
65 65
 
66
-        return json_decode($json, $assoc, $depth, JSON_THROW_ON_ERROR | $options);
66
+        return json_decode($json, $assoc, $depth, JSON_THROW_ON_ERROR|$options);
67 67
     }
68 68
 }
Please login to merge, or discard this patch.
src/Rest/ResponseHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Rest/ResponseHandler.php
5 5
  *
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             );
86 86
 
87 87
             $groups = array_merge([$entityName], $populate);
88
-            $filter = static fn (string $groupName): bool => strncmp($groupName, 'Set.', 4) === 0;
88
+            $filter = static fn(string $groupName): bool => strncmp($groupName, 'Set.', 4) === 0;
89 89
 
90 90
             if (array_key_exists('populateOnly', $request->query->all())
91 91
                 || array_values(array_filter($groups, $filter)) !== []
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         /** @var FormError $error */
130 130
         foreach ($form->getErrors(true) as $error) {
131
-            $name = $error->getOrigin()?->getName() ?? '';
131
+            $name = $error->getOrigin() ? ->getName() ?? '';
132 132
 
133 133
             $errors[] = sprintf(
134 134
                 'Field \'%s\': %s',
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         if ($populateAll && $populate === []) {
164 164
             $associations = $restResource->getAssociations();
165 165
             $populate = array_map(
166
-                static fn (string $assocName): string => $entityName . '.' . $assocName,
166
+                static fn(string $assocName): string => $entityName . '.' . $assocName,
167 167
                 $associations,
168 168
             );
169 169
         }
Please login to merge, or discard this patch.
src/Rest/RepositoryHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Rest/RepositoryHelper.php
5 5
  *
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     private static function processExpression(QueryBuilder $queryBuilder, Composite $expression, array $criteria): void
251 251
     {
252
-        $iterator = static function (array $comparison, string | int $key) use ($queryBuilder, $expression): void {
252
+        $iterator = static function (array $comparison, string|int $key) use ($queryBuilder, $expression): void {
253 253
             $expressionAnd = ($key === 'and' || array_key_exists('and', $comparison));
254 254
             $expressionOr = ($key === 'or' || array_key_exists('or', $comparison));
255 255
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
      *
294 294
      * @return array{0: string, 1: string, 2: string|array<int, string>}
295 295
      */
296
-    private static function createCriteria(string $column, string | array $value): array
296
+    private static function createCriteria(string $column, string|array $value): array
297 297
     {
298 298
         if (!str_contains($column, '.')) {
299 299
             $column = 'entity.' . $column;
@@ -357,14 +357,14 @@  discard block
 block discarded – undo
357 357
         } else {
358 358
             // Otherwise this must be IN or NOT IN expression
359 359
             try {
360
-                $value = array_map(static fn (string $value): string => UuidHelper::getBytes($value), $value);
360
+                $value = array_map(static fn(string $value): string => UuidHelper::getBytes($value), $value);
361 361
             } catch (InvalidUuidStringException $exception) {
362 362
                 // Ok so value isn't list of UUIDs
363 363
                 syslog(LOG_INFO, $exception->getMessage());
364 364
             }
365 365
 
366 366
             $parameters[] = array_map(
367
-                static fn (string $value): Literal => $queryBuilder->expr()->literal(
367
+                static fn(string $value): Literal => $queryBuilder->expr()->literal(
368 368
                     is_numeric($value) ? (int)$value : $value
369 369
                 ),
370 370
                 $value
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      */
380 380
     private static function getIterator(array &$condition): Closure
381 381
     {
382
-        return static function (string | array $value, string $column) use (&$condition): void {
382
+        return static function (string|array $value, string $column) use (&$condition): void {
383 383
             // If criteria contains 'and' OR 'or' key(s) assume that array in only in the right format
384 384
             if (strcmp($column, 'and') === 0 || strcmp($column, 'or') === 0) {
385 385
                 $condition[$column] = $value;
Please login to merge, or discard this patch.
src/Decorator/StopwatchDecorator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Decorator/StopwatchDecorator.php
5 5
  *
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $suffixInterceptors = [];
63 63
 
64 64
         $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
65
-        $methods = array_filter($methods, static fn ($method): bool => !$method->isStatic() && !$method->isFinal());
65
+        $methods = array_filter($methods, static fn($method): bool => !$method->isStatic() && !$method->isFinal());
66 66
 
67 67
         foreach ($methods as $method) {
68 68
             $methodName = $method->getName();
Please login to merge, or discard this patch.
src/Command/Utils/CreateDateDimensionEntitiesCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Command/Utils/CreateDateDimensionEntitiesCommand.php
5 5
  *
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      */
170 170
     private function validatorYearStart(): Closure
171 171
     {
172
-        return static fn (int $year): int => $year < self::YEAR_MIN || $year > self::YEAR_MAX
172
+        return static fn(int $year): int => $year < self::YEAR_MIN || $year > self::YEAR_MAX
173 173
             ? throw new InvalidArgumentException(
174 174
                 sprintf(
175 175
                     'Start year must be between %d and %d',
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      */
188 188
     private function validatorYearEnd(int $yearStart): Closure
189 189
     {
190
-        return static fn (int $year): int => $year < self::YEAR_MIN || $year > self::YEAR_MAX || $year < $yearStart
190
+        return static fn(int $year): int => $year < self::YEAR_MIN || $year > self::YEAR_MAX || $year < $yearStart
191 191
             ? throw new InvalidArgumentException(
192 192
                 sprintf(
193 193
                     'End year must be between %d and %d and after given start year %d',
Please login to merge, or discard this patch.