@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function adminlte_image() |
38 | 38 | { |
39 | 39 | $urlPicture = $this->path_picture != "" ? asset('storage/'.str_replace('app/public/', '', $this->path_picture)) : null; |
40 | - if(!isset($urlPicture) || $urlPicture === ""){ |
|
40 | + if (!isset($urlPicture) || $urlPicture === "") { |
|
41 | 41 | $urlPicture = url('').'/'.config('adminlte.logo_img'); |
42 | 42 | } |
43 | 43 | return $urlPicture; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function adminlte_desc() |
47 | 47 | { |
48 | 48 | $desc = $this->firstname.' '.$this->lastname; |
49 | - if($this->organization_id !== null){ |
|
49 | + if ($this->organization_id !== null) { |
|
50 | 50 | $organization = app(OrganizationRepository::class)->get($this->organization_id); |
51 | 51 | $desc .= ' - organisme : '.$organization->name(); |
52 | 52 | } |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | |
86 | 86 | public function addCharacteristics(array $characteristics) |
87 | 87 | { |
88 | - foreach($characteristics as $characteristicUuid){ |
|
89 | - $characteristic = CharacteristicsModel::where('uuid', (string)$characteristicUuid)->first(); |
|
90 | - if(isset($characteristic)) { |
|
88 | + foreach ($characteristics as $characteristicUuid) { |
|
89 | + $characteristic = CharacteristicsModel::where('uuid', (string) $characteristicUuid)->first(); |
|
90 | + if (isset($characteristic)) { |
|
91 | 91 | $this->characteristics()->save($characteristic); |
92 | 92 | } |
93 | 93 | } |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | public function syncCharacteristics(array $characteristics) |
97 | 97 | { |
98 | 98 | $characteristicsToSync = []; |
99 | - foreach($characteristics as $characteristicUuid){ |
|
100 | - $characteristicModel = CharacteristicsModel::where('uuid', (string)$characteristicUuid)->first(); |
|
101 | - if(isset($characteristicModel)) { |
|
99 | + foreach ($characteristics as $characteristicUuid) { |
|
100 | + $characteristicModel = CharacteristicsModel::where('uuid', (string) $characteristicUuid)->first(); |
|
101 | + if (isset($characteristicModel)) { |
|
102 | 102 | $characteristicsToSync[] = $characteristicModel->id; |
103 | 103 | } |
104 | 104 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $farmingType = $request->input('farming_type') !== null ? $request->input('farming_type') : []; |
45 | 45 | |
46 | 46 | $fillWikiUserProfile->fill(Auth::user()->uuid, $role, $firstname, $lastname, $email, $postalCode, $farmingType); |
47 | - if(session()->has('wiki_callback')){ |
|
47 | + if (session()->has('wiki_callback')) { |
|
48 | 48 | return $this->redirectToWiki(); |
49 | 49 | } |
50 | 50 | return redirect(config('neayi.wiki_url')); |
@@ -13,10 +13,10 @@ |
||
13 | 13 | |
14 | 14 | private function toArray(array $properties) |
15 | 15 | { |
16 | - foreach ($properties as $key => $property){ |
|
17 | - if(is_object($property)){ |
|
16 | + foreach ($properties as $key => $property) { |
|
17 | + if (is_object($property)) { |
|
18 | 18 | $params[$this->camelToSnake($key)] = $this->toArray(get_object_vars($property)); |
19 | - }else { |
|
19 | + } else { |
|
20 | 20 | $params[$this->camelToSnake($key)] = $property; |
21 | 21 | } |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | foreach ($properties as $key => $property){ |
17 | 17 | if(is_object($property)){ |
18 | 18 | $params[$this->camelToSnake($key)] = $this->toArray(get_object_vars($property)); |
19 | - }else { |
|
19 | + } else { |
|
20 | 20 | $params[$this->camelToSnake($key)] = $property; |
21 | 21 | } |
22 | 22 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $this->department = $departmentNumber; |
41 | 41 | $this->fullname = $this->fullname(); |
42 | 42 | $characteristicsByType = []; |
43 | - foreach($characteristics as $characteristic){ |
|
43 | + foreach ($characteristics as $characteristic) { |
|
44 | 44 | $characteristicsByType[$characteristic->type()][] = $characteristic; |
45 | 45 | } |
46 | 46 |
@@ -26,12 +26,12 @@ |
||
26 | 26 | |
27 | 27 | public function toDto():ContextDto |
28 | 28 | { |
29 | - $characteristics = $this->user->characteristics()->get()->transform(function(CharacteristicsModel $item){ |
|
29 | + $characteristics = $this->user->characteristics()->get()->transform(function(CharacteristicsModel $item) { |
|
30 | 30 | return $item->toDto(); |
31 | 31 | }); |
32 | 32 | $characteristicDepartment = CharacteristicsModel::query()->where('code', $this->department_number)->first(); |
33 | 33 | |
34 | - if(isset($characteristicDepartment)){ |
|
34 | + if (isset($characteristicDepartment)) { |
|
35 | 35 | $characteristics->push($characteristicDepartment->toDto()); |
36 | 36 | } |
37 | 37 |