@@ -73,7 +73,7 @@ |
||
73 | 73 | public function updateMandatary(?int $mandataryId) |
74 | 74 | { |
75 | 75 | $pivotIds = $this->people->pluck('id')->reduce( |
76 | - fn ($pivot, $value) => $pivot |
|
76 | + fn($pivot, $value) => $pivot |
|
77 | 77 | ->put($value, ['is_mandatary' => $value === $mandataryId]), |
78 | 78 | new Collection() |
79 | 79 | )->toArray(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | public function scopeForUser($query, $user) |
52 | 52 | { |
53 | - $query->when(! $user->isAdmin() && ! $user->isSupervisor(), fn ($query) => $query |
|
53 | + $query->when(!$user->isAdmin() && !$user->isSupervisor(), fn($query) => $query |
|
54 | 54 | ->whereCreatedBy($user->id)); |
55 | 55 | } |
56 | 56 | |
@@ -61,16 +61,16 @@ discard block |
||
61 | 61 | |
62 | 62 | public function scopeBetween($query, $interval) |
63 | 63 | { |
64 | - $query->when($interval->min, fn ($query) => $query->where( |
|
64 | + $query->when($interval->min, fn($query) => $query->where( |
|
65 | 65 | 'created_at', '>=', Carbon::parse($interval->min) |
66 | - ))->when($interval->max, fn ($query) => $query->where( |
|
66 | + ))->when($interval->max, fn($query) => $query->where( |
|
67 | 67 | 'created_at', '<=', Carbon::parse($interval->max) |
68 | 68 | )); |
69 | 69 | } |
70 | 70 | |
71 | 71 | public function scopeFilter($query, $search) |
72 | 72 | { |
73 | - return $query->when($search, fn ($query) => $query |
|
73 | + return $query->when($search, fn($query) => $query |
|
74 | 74 | ->where('original_name', 'LIKE', '%'.$search.'%')); |
75 | 75 | } |
76 | 76 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | public function userList() |
28 | 28 | { |
29 | - return $this->users->map(fn ($user) => [ |
|
29 | + return $this->users->map(fn($user) => [ |
|
30 | 30 | 'name' => $user->person->name, |
31 | 31 | 'avatar' => $user->avatar, |
32 | 32 | ]); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function updateMembers(array $memberIds) |
36 | 36 | { |
37 | 37 | $synced = $this->users()->sync($memberIds); |
38 | - if (! empty($synced['attached']) || ! empty($synced['detached'])) { |
|
38 | + if (!empty($synced['attached']) || !empty($synced['detached'])) { |
|
39 | 39 | $this->fireModelEvent('updated-members', false); |
40 | 40 | } |
41 | 41 | } |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | ); |
27 | 27 | |
28 | 28 | $this->extraLangs() |
29 | - ->each(fn ($locale) => $this->updateDifferences($locale)); |
|
29 | + ->each(fn($locale) => $this->updateDifferences($locale)); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function addKey() |
33 | 33 | { |
34 | 34 | $this->extraLangs() |
35 | - ->each(fn ($locale) => $this->processKey($locale)); |
|
35 | + ->each(fn($locale) => $this->processKey($locale)); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | private function processKey($locale) |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ->keys(); |
62 | 62 | |
63 | 63 | $extraLangFile = (new Collection($extraLangFile)) |
64 | - ->filter(fn ($key) => $keysToRemove->contains($key)); |
|
64 | + ->filter(fn($key) => $keysToRemove->contains($key)); |
|
65 | 65 | |
66 | 66 | return [$keysToRemove->count(), $extraLangFile->toArray()]; |
67 | 67 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | protected function newTranslations(array $array): Collection |
17 | 17 | { |
18 | 18 | return (new Collection($array))->keys() |
19 | - ->mapWithKeys(fn ($key) => [$key => null]); |
|
19 | + ->mapWithKeys(fn($key) => [$key => null]); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | protected function saveMerged(string $locale, array $langFile): void |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $languages->pluck('name') |
49 | - ->each(fn ($locale) => $this->mergeLocale($locale)); |
|
49 | + ->each(fn($locale) => $this->mergeLocale($locale)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | private function mergeLocale(string $locale): void |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function run() |
27 | 27 | { |
28 | - DB::transaction(function () { |
|
28 | + DB::transaction(function() { |
|
29 | 29 | $oldName = $this->language->name; |
30 | 30 | $this->language->updateWithFlagSufix($this->request, $this->flagSufix); |
31 | 31 | $this->updateLangFiles($oldName, $this->request['name']); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | public function create() |
22 | 22 | { |
23 | - return DB::transaction(function () { |
|
23 | + return DB::transaction(function() { |
|
24 | 24 | $language = (new Language()) |
25 | 25 | ->storeWithFlagSufix($this->request, $this->flagSuffix); |
26 | 26 |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | private function build(?int $parentId = null): Collection |
25 | 25 | { |
26 | 26 | return $this->menus |
27 | - ->filter(fn ($menu) => $menu->parent_id === $parentId) |
|
28 | - ->reduce(fn ($tree, $menu) => $tree |
|
27 | + ->filter(fn($menu) => $menu->parent_id === $parentId) |
|
28 | + ->reduce(fn($tree, $menu) => $tree |
|
29 | 29 | ->push($this->withChildren($menu)), new Collection()); |
30 | 30 | } |
31 | 31 | |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | |
64 | 64 | private function filter(): self |
65 | 65 | { |
66 | - $this->menus = $this->menus->filter(fn ($menu) => $this->allowed($menu)); |
|
66 | + $this->menus = $this->menus->filter(fn($menu) => $this->allowed($menu)); |
|
67 | 67 | |
68 | 68 | return $this; |
69 | 69 | } |
70 | 70 | |
71 | 71 | private function map(): self |
72 | 72 | { |
73 | - $this->menus = $this->menus->map(fn ($menu) => $this->computeIcon($menu)); |
|
73 | + $this->menus = $this->menus->map(fn($menu) => $this->computeIcon($menu)); |
|
74 | 74 | |
75 | 75 | return $this; |
76 | 76 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | private function someChildrenAllowed($parent): bool |
94 | 94 | { |
95 | 95 | return $this->menus->some( |
96 | - fn ($child) => $child->parent_id === $parent->id && $this->allowed($child) |
|
96 | + fn($child) => $child->parent_id === $parent->id && $this->allowed($child) |
|
97 | 97 | ); |
98 | 98 | } |
99 | 99 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | private function organize(Obj $menus): void |
23 | 23 | { |
24 | - $menus->each(fn ($menu, $index) => $this->reorder($menu, $index)); |
|
24 | + $menus->each(fn($menu, $index) => $this->reorder($menu, $index)); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | private function reorder(Obj $menu, int $index): void |