Completed
Pull Request — master (#78)
by guillaume
07:10
created
app/Src/UseCases/Domain/Context/UseCases/CreateCharacteristic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     public function execute(string $id, string $type, string $title)
31 31
     {
32 32
         $characteristic = $this->characteristicRepository->getBy(['title' => $title, 'type' => $type]);
33
-        if(isset($characteristic)){
33
+        if (isset($characteristic)) {
34 34
             throw new CharacteristicAlreadyExists();
35 35
         }
36 36
         $characteristic = new Characteristic($id, $type, $title, false);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Dto/ContextDto.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         $this->postalCode = $postalCode;
34 34
         $this->department = (new PostalCode($postalCode))->department();
35 35
         $this->characteristics = $characteristics;
36
-        foreach($this->characteristics as $characteristic){
36
+        foreach ($this->characteristics as $characteristic) {
37 37
             $this->characteristicsByType[$characteristic->type()][] = $characteristic;
38 38
         }
39 39
         $this->description = $description;
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Dto/PractiseVo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         $this->doneAt = $doneAt;
18 18
     }
19 19
 
20
-    public function doneAt():?\DateTime
20
+    public function doneAt(): ?\DateTime
21 21
     {
22 22
         return $this->doneAt;
23 23
     }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Dto/CharacteristicDto.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     public $type;
13 13
     public $icon;
14 14
 
15
-    public function __construct(string $uuid,  string $label, string $type, ?string $icon, $prettyLabel)
15
+    public function __construct(string $uuid, string $label, string $type, ?string $icon, $prettyLabel)
16 16
     {
17 17
         $this->uuid = $uuid;
18 18
         $this->label = $label;
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Queries/GetLastWikiUserComments.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $userData = $user->toArray();
29 29
         $username = ucfirst($userData['firstname']).'_'.ucfirst($userData['lastname']);
30 30
         $comments = Cache::get("comments_".$userId);
31
-        if(isset($comments)){
31
+        if (isset($comments)) {
32 32
             return json_decode($comments, true);
33 33
         }
34 34
 
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
         $comments = $content['query']['usercontribs'];
38 38
 
39 39
         $commentsToRetrieved = [];
40
-        foreach($comments as $comment){
41
-            if(!isset($commentsToRetrieved[$comment['pageid']])) {
40
+        foreach ($comments as $comment) {
41
+            if (!isset($commentsToRetrieved[$comment['pageid']])) {
42 42
                 $commentsToRetrieved[$comment['pageid']] = $comment;
43 43
             }
44 44
         }
45 45
 
46
-        foreach($commentsToRetrieved as $pageId => $commentToRetrieved){
46
+        foreach ($commentsToRetrieved as $pageId => $commentToRetrieved) {
47 47
             $response = $this->httpClient->get(config('wiki.api_uri').$this->commentEndPoint.$pageId);
48 48
             $content = json_decode($response->getBody()->getContents(), true);
49 49
             $commentsToRetrieved[$pageId] = array_merge($commentsToRetrieved[$pageId], $content['csquerycomment']);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Queries/ContextQueryByUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $this->contextRepository = $contextRepository;
17 17
     }
18 18
 
19
-    public function execute(string $userId):?ContextDto
19
+    public function execute(string $userId): ?ContextDto
20 20
     {
21 21
         return $this->contextRepository->getByUserDto($userId);
22 22
     }
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()->format('Y');
24 24
             $practisesToReturn[$year][] = $practise->toArray();
25 25
         }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Queries/InteractionsQueryByPageAndUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         $this->authGateway = $authGateway;
26 26
     }
27 27
 
28
-    public function execute(int $pageId):?Interaction
28
+    public function execute(int $pageId): ?Interaction
29 29
     {
30 30
         $canInteractUser = $this->getInteractUser();
31 31
         return $this->interactionRepository->getByInteractUser($canInteractUser, $pageId);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Queries/GetIcon.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@
 block discarded – undo
18 18
         $h = $img->height();
19 19
         $w = $img->width();
20 20
 
21
-        if($dim == null){
21
+        if ($dim == null) {
22 22
             return $img->response();
23 23
         }
24 24
 
25 25
         $img = Image::cache(function($image) use($pathPicture, $dim, $w, $h){
26
-            if($w <= $h) {
27
-                $image->make($pathPicture)->widen($dim, function ($constraint) {
26
+            if ($w <= $h) {
27
+                $image->make($pathPicture)->widen($dim, function($constraint) {
28 28
                     $constraint->upsize();
29 29
                 });
30
-            }else{
31
-                $image->make($pathPicture)->heighten($dim, function ($constraint) {
30
+            } else {
31
+                $image->make($pathPicture)->heighten($dim, function($constraint) {
32 32
                     $constraint->upsize();
33 33
                 });
34 34
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
                 $image->make($pathPicture)->widen($dim, function ($constraint) {
32 32
                     $constraint->upsize();
33 33
                 });
34
-            }else{
34
+            } else{
35 35
                 $image->make($pathPicture)->heighten($dim, function ($constraint) {
36 36
                     $constraint->upsize();
37 37
                 });
Please login to merge, or discard this patch.