Passed
Push — master ( eb6d38...49440b )
by Bertrand
08:06
created
app/Src/UseCases/Domain/Context/Queries/SearchCharacteristics.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
 
18 18
     public function execute(string $type, string $search):array
19 19
     {
20
-        if($type === 'farming') {
20
+        if ($type === 'farming') {
21 21
             $type = 'culture';
22 22
         }
23
-        if($type === 'croppingSystem') {
23
+        if ($type === 'croppingSystem') {
24 24
             $type = 'label';
25 25
         }
26 26
         return $this->pageRepository->search($type, $search);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Ports/PageRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 interface PageRepository
10 10
 {
11
-    public function get(string $pageId):?Page;
11
+    public function get(string $pageId): ?Page;
12 12
     public function getByIds(array $pagesId):array;
13 13
     public function save(Page $page);
14 14
 }
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Sql/PageRepositorySql.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     public function get(string $pageId): ?Page
15 15
     {
16 16
         $pageModel = PageModel::where('page_id', $pageId)->first();
17
-        if(!isset($pageModel)){
17
+        if (!isset($pageModel)) {
18 18
             return null;
19 19
         }
20 20
         return new Page($pageModel->page_id, $pageModel->dry);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     public function save(Page $page)
35 35
     {
36 36
         $pageModel = PageModel::where('page_id', $page->pageId())->first();
37
-        if(!isset($pageModel)){
37
+        if (!isset($pageModel)) {
38 38
             $pageModel = new PageModel();
39 39
         }
40 40
         $pageModel->page_id = $page->pageId();
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     public function search(string $type, string $search):array
46 46
     {
47 47
         $pageModel = PageModel::query()
48
-            ->where('title','LIKE', '%'.$search.'%')
48
+            ->where('title', 'LIKE', '%'.$search.'%')
49 49
             ->where('type', $type)
50 50
             ->get();
51 51
 
52
-        if(!isset($pageModel)){
52
+        if (!isset($pageModel)) {
53 53
             return [];
54 54
         }
55 55
         return $pageModel->toArray();
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/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/CharacteristicMemento.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
         return $this->visible;
46 46
     }
47 47
 
48
-    public function icon():? string
48
+    public function icon(): ? string
49 49
     {
50 50
         return $this->icon;
51 51
     }
52 52
 
53
-    public function pageId():? int
53
+    public function pageId(): ? int
54 54
     {
55 55
         return $this->pageId;
56 56
     }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Queries/GetUserPractises.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     {
20 20
         $practisesToReturn = [];
21 21
         $practises = $this->interactionsRepository->getDoneByUser($userId);
22
-        foreach ($practises as $practise){
22
+        foreach ($practises as $practise) {
23 23
             $year = $practise->doneAt() !== null ? $practise->doneAt()->format('Y') : 'Non datée';
24 24
             $practisesToReturn[$year][] = $practise->toArray();
25 25
         }
Please login to merge, or discard this patch.
app/Console/Commands/SyncDryPagesFromWiki.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $httpClient = new Client();
26 26
 
27
-        PageModel::query()->where('dry', true)->chunkById(50, function ($items, $count) use($httpClient){
27
+        PageModel::query()->where('dry', true)->chunkById(50, function($items, $count) use($httpClient){
28 28
             $this->info(($count*50).' Pages');
29 29
             $pages = $items->pluck('page_id')->toArray();
30 30
             $pagesApiUri = config('wiki.api_uri').$this->queryPages.implode('|', $pages);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             $content = json_decode($response->getBody()->getContents(), true);
33 33
             $wikiPages = $content['query']['pages'];
34 34
 
35
-            foreach($wikiPages as $page){
35
+            foreach ($wikiPages as $page) {
36 36
                 $pageModel = PageModel::query()->where('page_id', $page['pageid'])->first();
37 37
 
38 38
                 if (!isset($page['title']))
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/User.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
         return $this->firstname.' '.$this->lastname;
62 62
     }
63 63
 
64
-    public function organizationId():?string
64
+    public function organizationId(): ?string
65 65
     {
66 66
         return $this->organizationId;
67 67
     }
68 68
 
69 69
     public function provider(string $provider, string $providerId):bool
70 70
     {
71
-        if(isset($this->providers[$provider]) && $this->providers[$provider] == $providerId){
71
+        if (isset($this->providers[$provider]) && $this->providers[$provider] == $providerId) {
72 72
             return true;
73 73
         }
74 74
         return false;
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 
88 88
     public function create(string $passwordHashed = null, Picture $picture = null)
89 89
     {
90
-        if(isset($picture)) {
91
-            $picture->resize('app/public/users/' . $this->id);
90
+        if (isset($picture)) {
91
+            $picture->resize('app/public/users/'.$this->id);
92 92
             $this->pathPicture = $picture->relativePath();
93 93
         }
94 94
         app(UserRepository::class)->add($this, $passwordHashed);
@@ -130,20 +130,20 @@  discard block
 block discarded – undo
130 130
         $this->email = $email;
131 131
         $this->firstname = $firstname;
132 132
         $this->lastname = $lastname;
133
-        if($pathPicture !== "") {
133
+        if ($pathPicture !== "") {
134 134
             $picture = new Picture($pathPicture);
135
-            $picture->resize('app/public/users/' . $this->id . '.' . $ext);
136
-            $this->pathPicture = 'app/public/users/' . $this->id . '.' . $ext;
135
+            $picture->resize('app/public/users/'.$this->id.'.'.$ext);
136
+            $this->pathPicture = 'app/public/users/'.$this->id.'.'.$ext;
137 137
         }
138 138
         app(UserRepository::class)->update($this);
139 139
     }
140 140
 
141 141
     public function updateAvatar(string $pathPicture, string $ext = 'jpg')
142 142
     {
143
-        if($pathPicture !== "") {
143
+        if ($pathPicture !== "") {
144 144
             $picture = new Picture($pathPicture);
145
-            $picture->resize('app/public/users/' . $this->id . '.' . $ext);
146
-            $this->pathPicture = 'app/public/users/' . $this->id . '.' . $ext;
145
+            $picture->resize('app/public/users/'.$this->id.'.'.$ext);
146
+            $this->pathPicture = 'app/public/users/'.$this->id.'.'.$ext;
147 147
         }
148 148
         app(UserRepository::class)->update($this);
149 149
         return $this->pathPicture;
Please login to merge, or discard this patch.