Completed
Pull Request — master (#77)
by guillaume
07:36
created
app/Src/UseCases/Domain/Users/GetAvatar.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
         $w = $img->width();
28 28
 
29 29
         $img = Image::cache(function($image) use($pathPicture, $dim, $w, $h){
30
-            if($w <= $h) {
31
-                $image->make($pathPicture)->widen($dim, function ($constraint) {
30
+            if ($w <= $h) {
31
+                $image->make($pathPicture)->widen($dim, function($constraint) {
32 32
                     $constraint->upsize();
33 33
                 });
34
-            }else{
35
-                $image->make($pathPicture)->heighten($dim, function ($constraint) {
34
+            } else {
35
+                $image->make($pathPicture)->heighten($dim, function($constraint) {
36 36
                     $constraint->upsize();
37 37
                 });
38 38
             }
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Gateway/SocialiteGatewayImpl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
 {
13 13
     public function user(string $provider): SocialiteUser
14 14
     {
15
-        if($provider === 'twitter'){
15
+        if ($provider === 'twitter') {
16 16
             $user = Socialite::driver($provider)->user();
17
-        }else {
17
+        } else {
18 18
             $user = Socialite::driver($provider)->stateless()->user();
19 19
         }
20 20
 
21 21
         $email = $user->getEmail();
22 22
         $firstname = $user->getNickname() !== null ? $user->getNickname() : $user->getName();
23
-        if(isset($user->user['given_name'])){
23
+        if (isset($user->user['given_name'])) {
24 24
             $firstname = $user->user['given_name'];
25 25
         }
26 26
         $lastname = isset($user->user['family_name']) ? $user->user['family_name'] : $user->getName();
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Sql/Model/CharacteristicsModel.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
     public function toDto()
34 34
     {
35 35
         $icon = null;
36
-        if(isset($this->icon)){
36
+        if (isset($this->icon)) {
37 37
             $icon = route('api.icon.serve', ['id' => $this->uuid]);
38 38
         }
39 39
         return new CharacteristicDto(
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Sql/CharacteristicsRepositorySql.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
      */
26 26
     public function add(array $cs)
27 27
     {
28
-        foreach ($cs as $c){
28
+        foreach ($cs as $c) {
29 29
             $cModel = new CharacteristicsModel();
30 30
             $cModel->fill($c);
31 31
             $cModel->save();
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Agricultural/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/Agricultural/Queries/GetIcon.php 1 patch
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.
app/Src/UseCases/Domain/Agricultural/Model/PostalCode.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
 
16 16
     public function department():string
17 17
     {
18
-        if(substr($this->postalCode, 0, 2) > 96){
19
-            return substr($this->postalCode, 0,3);
18
+        if (substr($this->postalCode, 0, 2) > 96) {
19
+            return substr($this->postalCode, 0, 3);
20 20
         }
21
-        return substr($this->postalCode, 0,2);
21
+        return substr($this->postalCode, 0, 2);
22 22
     }
23 23
 }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Shared/Model/Picture.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@
 block discarded – undo
22 22
     {
23 23
         $relativePath = $newPath;
24 24
         $finalNewPath = storage_path().'/'.$newPath;
25
-        if(isset($this->ext)){
25
+        if (isset($this->ext)) {
26 26
             $finalNewPath = storage_path().'/'.$newPath.'.'.$this->ext;
27 27
             $relativePath = $newPath.'.'.$this->ext;
28 28
         }
29
-        if(app(PictureHandler::class)->width($this->path) > 600) {
29
+        if (app(PictureHandler::class)->width($this->path) > 600) {
30 30
             app(PictureHandler::class)->widen($this->path, $finalNewPath, 600);
31 31
             $this->relativePath = $relativePath;
32 32
             return;
33 33
         }
34 34
 
35
-        if(app(PictureHandler::class)->height($this->path) > 400) {
35
+        if (app(PictureHandler::class)->height($this->path) > 400) {
36 36
             app(PictureHandler::class)->heighten($this->path, $finalNewPath, 400);
37 37
             $this->relativePath = $relativePath;
38 38
             return;
Please login to merge, or discard this patch.
Domain/Organizations/Invitation/RespondInvitationToAnOrganization.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,23 +39,23 @@
 block discarded – undo
39 39
         $organizationToJoin = $this->organizationRepository->get($organizationId);
40 40
 
41 41
         $currentUser = $this->authGateway->current();
42
-        if(isset($currentUser) && $currentUser->email() !== $email){
42
+        if (isset($currentUser) && $currentUser->email() !== $email) {
43 43
             $action = 'logout';
44 44
             $action .= !isset($user) ? '-register' : '-login';
45 45
 
46
-            if($action == 'logout-login') {
46
+            if ($action == 'logout-login') {
47 47
                 return $this->badUserLoginToAcceptAction($action, $organizationToJoin);
48 48
             }
49 49
             return $this->returnLogoutAction($action, $organizationToJoin, $email, $firstname, $lastname);
50 50
         }
51 51
 
52 52
 
53
-        if(!isset($user)){
53
+        if (!isset($user)) {
54 54
             return $this->returnRegisterAction($organizationId, $email, $firstname, $lastname);
55 55
         }
56 56
 
57 57
         $currentUser = $this->authGateway->current();
58
-        if(!isset($currentUser)){
58
+        if (!isset($currentUser)) {
59 59
             return $this->returnLoginAction($organizationToJoin);
60 60
         }
61 61
 
Please login to merge, or discard this patch.