@@ -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 | |