Completed
Push — master ( 0233f4...0c7686 )
by Tarmo
33s queued 23s
created
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.
rector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * rector.php
5 5
  */
Please login to merge, or discard this patch.
src/Entity/Role.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/Entity/Role.php
5 5
  *
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     #[Groups([
56 56
         'Role.userGroups',
57 57
     ])]
58
-    private Collection | ArrayCollection $userGroups;
58
+    private Collection|ArrayCollection $userGroups;
59 59
 
60 60
     public function __construct(
61 61
         #[ORM\Id]
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     /**
96 96
      * @return Collection<int, UserGroup>|ArrayCollection<int, UserGroup>
97 97
      */
98
-    public function getUserGroups(): Collection | ArrayCollection
98
+    public function getUserGroups(): Collection|ArrayCollection
99 99
     {
100 100
         return $this->userGroups;
101 101
     }
Please login to merge, or discard this patch.
src/Entity/LogRequest.php 1 patch
Spacing   +9 added lines, -9 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/Entity/LogRequest.php
5 5
  *
@@ -118,24 +118,24 @@  discard block
 block discarded – undo
118 118
         ?Request $request = null,
119 119
         ?Response $response = null,
120 120
         #[ORM\ManyToOne(
121
-            targetEntity: User::class,
122
-            inversedBy: 'logsRequest',
121
+            targetEntity : User::class,
122
+            inversedBy : 'logsRequest',
123 123
         )]
124 124
         #[ORM\JoinColumn(
125
-            name: 'user_id',
126
-            onDelete: 'SET NULL',
125
+            name : 'user_id',
126
+            onDelete : 'SET NULL',
127 127
         )]
128 128
         #[Groups([
129 129
             'LogRequest.user',
130 130
         ])]
131 131
         private ?User $user = null,
132 132
         #[ORM\ManyToOne(
133
-            targetEntity: ApiKey::class,
134
-            inversedBy: 'logsRequest',
133
+            targetEntity : ApiKey::class,
134
+            inversedBy : 'logsRequest',
135 135
         )]
136 136
         #[ORM\JoinColumn(
137
-            name: 'api_key_id',
138
-            onDelete: 'SET NULL',
137
+            name : 'api_key_id',
138
+            onDelete : 'SET NULL',
139 139
         )]
140 140
         #[Groups([
141 141
             'LogRequest.apiKey',
Please login to merge, or discard this patch.
src/Entity/ApiKey.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/Entity/ApiKey.php
5 5
  *
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     #[Groups([
114 114
         'ApiKey.userGroups',
115 115
     ])]
116
-    private Collection | ArrayCollection $userGroups;
116
+    private Collection|ArrayCollection $userGroups;
117 117
 
118 118
     /**
119 119
      * @var Collection<int, LogRequest>|ArrayCollection<int, LogRequest>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     #[Groups([
126 126
         'ApiKey.logsRequest',
127 127
     ])]
128
-    private Collection | ArrayCollection $logsRequest;
128
+    private Collection|ArrayCollection $logsRequest;
129 129
 
130 130
     /**
131 131
      * ApiKey constructor.
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      *
192 192
      * @return Collection<int, UserGroup>|ArrayCollection<int, UserGroup>
193 193
      */
194
-    public function getUserGroups(): Collection | ArrayCollection
194
+    public function getUserGroups(): Collection|ArrayCollection
195 195
     {
196 196
         return $this->userGroups;
197 197
     }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      *
202 202
      * @return Collection<int, LogRequest>|ArrayCollection<int, LogRequest>
203 203
      */
204
-    public function getLogsRequest(): Collection | ArrayCollection
204
+    public function getLogsRequest(): Collection|ArrayCollection
205 205
     {
206 206
         return $this->logsRequest;
207 207
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                     array_merge(
224 224
                         [RolesServiceInterface::ROLE_API],
225 225
                         $this->userGroups
226
-                            ->map(static fn (UserGroup $userGroup): string => $userGroup->getRole()->getId())
226
+                            ->map(static fn(UserGroup $userGroup): string => $userGroup->getRole()->getId())
227 227
                             ->toArray(),
228 228
                     ),
229 229
                 ),
Please login to merge, or discard this patch.
src/Controller/v1/User/DetachUserGroupController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * /src/Controller/v1/User/DetachUserGroupController.php
5 5
  *
Please login to merge, or discard this patch.