Passed
Pull Request — master (#78)
by guillaume
07:20
created
app/Src/UseCases/Domain/Context/UseCases/AddCharacteristicsToContext.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/UseCases/CreateCharacteristic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Model/CharacteristicMemento.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Model/Characteristic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Model/Page.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,17 +34,17 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Ports/CharacteristicsRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.