@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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(); |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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', |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * rector.php |
5 | 5 | */ |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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', |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | ), |
@@ -1,5 +1,5 @@ |
||
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 | * |