@@ -38,9 +38,9 @@ |
||
| 38 | 38 | $pages = $this->pageRepository->getByIds($pagesIds); |
| 39 | 39 | |
| 40 | 40 | $characteristics = []; |
| 41 | - foreach ($pages as $page){ |
|
| 41 | + foreach ($pages as $page) { |
|
| 42 | 42 | $characteristic = $this->characteristicsRepository->getByPageId($page->pageId()); |
| 43 | - if(!isset($characteristic)){ |
|
| 43 | + if (!isset($characteristic)) { |
|
| 44 | 44 | $type = $page->type() === 'culture' ? Characteristic::FARMING_TYPE : Characteristic::CROPPING_SYSTEM; |
| 45 | 45 | $characteristic = new Characteristic( |
| 46 | 46 | Uuid::uuid4(), |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function execute(string $id, string $type, string $title) |
| 30 | 30 | { |
| 31 | 31 | $characteristic = $this->characteristicRepository->getBy(['title' => $title, 'type' => $type]); |
| 32 | - if(!isset($characteristic)){ |
|
| 32 | + if (!isset($characteristic)) { |
|
| 33 | 33 | $characteristic = new Characteristic($id, $type, $title, false); |
| 34 | 34 | $characteristic->create(); |
| 35 | 35 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | return $this->visible; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public function icon():? string |
|
| 46 | + public function icon(): ? string |
|
| 47 | 47 | { |
| 48 | 48 | return $this->icon; |
| 49 | 49 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | public function create(string $icon = null) |
| 33 | 33 | { |
| 34 | - if(isset($icon)){ |
|
| 34 | + if (isset($icon)) { |
|
| 35 | 35 | copy(storage_path('app/'.$icon), storage_path('app/public/characteristics/'.$this->id.'.png')); |
| 36 | 36 | $this->icon = 'public/characteristics/'.$this->id.'.png'; |
| 37 | 37 | } |
@@ -34,17 +34,17 @@ |
||
| 34 | 34 | return $this->pageId; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public function title():?string |
|
| 37 | + public function title(): ?string |
|
| 38 | 38 | { |
| 39 | 39 | return $this->title; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function type():?string |
|
| 42 | + public function type(): ?string |
|
| 43 | 43 | { |
| 44 | 44 | return $this->type; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function icon():?string |
|
| 47 | + public function icon(): ?string |
|
| 48 | 48 | { |
| 49 | 49 | return $this->icon; |
| 50 | 50 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | public function getByType(string $type, bool $isMain):array; |
| 12 | 12 | public function getAllByType(string $type):array; |
| 13 | 13 | public function save(Characteristic $c); |
| 14 | - public function getBy(array $conditions):?Characteristic; |
|
| 14 | + public function getBy(array $conditions): ?Characteristic; |
|
| 15 | 15 | public function search(string $type, string $search):array; |
| 16 | - public function getByPageId(int $pageId):?Characteristic; |
|
| 16 | + public function getByPageId(int $pageId): ?Characteristic; |
|
| 17 | 17 | } |