Skip to content

Commit fc09e04

Browse files
author
Pantea Marius-ciclistu
committed
PSR12 fn ( to fn(
1 parent dbfe237 commit fc09e04

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/Eloquent/CustomRelations/Builders/CleverEloquentBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function with($relations, $callback = null): static
170170
$this->eagerLoad = \array_merge($this->eagerLoad, $this->parseWithRelations(
171171
(\is_array($relations) && \array_values($relations) === $relations) ?
172172
\array_map(
173-
fn (string $relation): \Closure => $callback,
173+
fn(string $relation): \Closure => $callback,
174174
\array_flip($relations)
175175
) :
176176
[$relations => $callback]

src/Eloquent/CustomRelations/HasCleverRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public function one()
281281
$builder->setQuery($builder->getQuery()->clone());
282282

283283
return new HasOneThrough(
284-
\tap($builder, fn (Builder $query): array => $query->getQuery()->joins = []),
284+
\tap($builder, fn(Builder $query): array => $query->getQuery()->joins = []),
285285
$this->farParent,
286286
$this->throughParent,
287287
$this->getFirstKeyName(),

src/Exports/ListResourceExcel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function getCollection(): Collection
8989
foreach ($this->data as $resourceWithRelationsModel) {
9090
/** @var BaseModel $resourceWithRelationsModel */
9191
$result[] = \array_diff_key($resourceWithRelationsModel->attributesToArray(), \array_flip(\array_map(
92-
fn (string $relation): string => Str::snake($relation),
92+
fn(string $relation): string => Str::snake($relation),
9393
$this->withRelations
9494
)));
9595
}
@@ -115,7 +115,7 @@ private function getRelationCollectionWithoutDuplicates(string $key): Collection
115115

116116
if (!\is_numeric(\array_key_first($properties[$snakeKey]))) {
117117
$result[] = \array_map(
118-
fn (mixed $val): string => (string)(\is_array($val) ? 'array not exported' : ($val ?? 'null')),
118+
fn(mixed $val): string => (string)(\is_array($val) ? 'array not exported' : ($val ?? 'null')),
119119
$properties[$snakeKey]
120120
);
121121

src/Models/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function getPrimaryKeyIdentifierAttribute(): mixed
117117
return $this->getKeyName() !== '' ?
118118
$this->getKey() :
119119
\implode($this::COMPOSITE_PK_SEPARATOR, \array_map(
120-
fn (mixed $value): mixed => (\is_array($value) ? \last($value) : $value),
120+
fn(mixed $value): mixed => (\is_array($value) ? \last($value) : $value),
121121
$this->getPrimaryKeyFilter()
122122
));
123123
}

src/Providers/ValidationServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function registerValidationFactory(): void
3636
$this->app->singleton('validator', function ($app) {
3737
$validator = new Factory($app['translator'], $app);
3838
$validator->resolver(
39-
fn ($translator, $data, $rules, $messages, $customAttributes): Validator => new class (
39+
fn($translator, $data, $rules, $messages, $customAttributes): Validator => new class (
4040
$translator,
4141
$data,
4242
$rules,
@@ -218,7 +218,7 @@ protected function validateUsingCustomRule($attribute, $value, $rule): void
218218
*/
219219
public function getRulesWithoutPlaceholders(): array
220220
{
221-
return (new Collection($this->rules))->mapWithKeys(fn (mixed $value, string $key): array => [
221+
return (new Collection($this->rules))->mapWithKeys(fn(mixed $value, string $key): array => [
222222
\str_replace('__dot__' . static::$placeholderHash, '\\.', $key) => $value,
223223
])->all();
224224
}

src/Services/BaseResourceService.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function list(array $request): Builder
7676
$filters !== []
7777
&& [] === \array_filter(
7878
GeneralHelper::filterDataByKeys($filters, $possibleSortColumns),
79-
fn (mixed $filter): bool => !\is_array($filter)
79+
fn(mixed $filter): bool => !\is_array($filter)
8080
)
8181
) {
8282
throw new \Exception('Ignoring filters');
@@ -96,25 +96,25 @@ public function list(array $request): Builder
9696
if (\is_array($request['withRelationsCount'] ?? null)) {
9797
$validRelations = $this->getValidRelations($request['withRelationsCount']);
9898
$builder->withCount(\array_map(
99-
fn (string $relationName): string => $relationName . ' as ' . $relationName .
99+
fn(string $relationName): string => $relationName . ' as ' . $relationName .
100100
static::COUNT_ALIAS_POSTFIX,
101101
$validRelations
102102
));
103103
$possibleSortColumns = \array_merge($possibleSortColumns, \array_map(
104-
fn (string $relationName): string => $relationName . static::COUNT_ALIAS_POSTFIX,
104+
fn(string $relationName): string => $relationName . static::COUNT_ALIAS_POSTFIX,
105105
$validRelations
106106
));
107107
}
108108

109109
if (\is_array($request['withRelationsExistence'] ?? null)) {
110110
$validRelations = $this->getValidRelations($request['withRelationsExistence']);
111111
$builder->withExists(\array_map(
112-
fn (string $relationName): string => $relationName . ' as ' . $relationName .
112+
fn(string $relationName): string => $relationName . ' as ' . $relationName .
113113
static::EXIST_ALIAS_POSTFIX,
114114
$validRelations
115115
));
116116
$possibleSortColumns = \array_merge($possibleSortColumns, \array_map(
117-
fn (string $relationName): string => $relationName . static::EXIST_ALIAS_POSTFIX,
117+
fn(string $relationName): string => $relationName . static::EXIST_ALIAS_POSTFIX,
118118
$validRelations
119119
));
120120
}

0 commit comments

Comments
 (0)