@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // add birthyear to person table ( for form builder ) |
| 122 | - if ($title == 'BIRT' && ! empty($date)) { |
|
| 122 | + if ($title == 'BIRT' && !empty($date)) { |
|
| 123 | 123 | $this->birthday = date('Y-m-d', strtotime($date)); |
| 124 | 124 | } |
| 125 | 125 | // add deathyear to person table ( for form builder ) |
| 126 | - if ($title == 'DEAT' && ! empty($date)) { |
|
| 126 | + if ($title == 'DEAT' && !empty($date)) { |
|
| 127 | 127 | $this->deathday = date('Y-m-d', strtotime($date)); |
| 128 | 128 | } |
| 129 | 129 | $this->save(); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | public function gender() |
| 173 | 173 | { |
| 174 | - if (! $this->title) { |
|
| 174 | + if (!$this->title) { |
|
| 175 | 175 | return; |
| 176 | 176 | } |
| 177 | 177 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | public function syncCompanies($companyIds, $mainCompanyId) |
| 191 | 191 | { |
| 192 | 192 | $pivotIds = (new Collection($companyIds)) |
| 193 | - ->reduce(fn ($pivot, $value) => $pivot->put($value, [ |
|
| 193 | + ->reduce(fn($pivot, $value) => $pivot->put($value, [ |
|
| 194 | 194 | 'is_main' => $value === $mainCompanyId, |
| 195 | 195 | 'is_mandatary' => false, |
| 196 | 196 | ]), new Collection()); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function initiateEmailActivationApi(User $user) |
| 22 | 22 | { |
| 23 | - if (! config('settings.activation') || ! $this->validateEmail($user)) { |
|
| 23 | + if (!config('settings.activation') || !$this->validateEmail($user)) { |
|
| 24 | 24 | return true; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -162,7 +162,7 @@ |
||
| 162 | 162 | public function erase(bool $person = false) |
| 163 | 163 | { |
| 164 | 164 | if ($person) { |
| 165 | - return DB::transaction(fn () => tap($this)->delete()->person->delete()); |
|
| 165 | + return DB::transaction(fn() => tap($this)->delete()->person->delete()); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | return $this->delete(); |
@@ -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']); |