Passed
Push — master ( 2b0762...9c76a8 )
by Bertrand
26:13 queued 17:43
created
app/Src/UseCases/Infra/Sql/SqlOrganizationRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
             ->select()
18 18
             ->where('uuid', $id)
19 19
             ->first();
20
-        if(!isset($record)){
20
+        if (!isset($record)) {
21 21
             return null;
22 22
         }
23 23
         $address = new Address($record->city, $record->address1, $record->address2, $record->postal_code);
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
             ->offset(($page-1)*$perPage)
43 43
             ->limit($perPage)
44 44
             ->get();
45
-        if(empty($records)){
45
+        if (empty($records)) {
46 46
             return [];
47 47
         }
48 48
         $organizations = [];
49
-        foreach($records as $record){
49
+        foreach ($records as $record) {
50 50
             $address = new Address($record->city, $record->address1, $record->address2, $record->postal_code);
51 51
             $organizations[] = new Organization($record->uuid, $record->name, $record->path_picture, $address);
52 52
         }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Ports/OrganizationRepository.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 OrganizationRepository
10 10
 {
11
-    public function get(string $id):? Organization;
11
+    public function get(string $id): ? Organization;
12 12
     public function add(Organization $o);
13 13
     public function update(Organization $o);
14 14
     public function search(int $page, int $perPage = 10): array;
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Users/GetUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     public function get(string $userId):User
21 21
     {
22 22
         $user = $this->userRepository->getById($userId);
23
-        if(!isset($user)){
23
+        if (!isset($user)) {
24 24
             throw new UserNotFound();
25 25
         }
26 26
         return $user;
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Users/EditUser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function edit(string $userId, string $email, string $firstname, string $lastname, array $picture)
21 21
     {
22 22
         $user = $this->userRepository->getById($userId);
23
-        if(!isset($user)){
23
+        if (!isset($user)) {
24 24
             throw new UserNotFound();
25 25
         }
26 26
         $this->validateData($userId, $firstname, $lastname, $email, $picture);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         if (isset($user) && $user->id() !== $userId) {
54 54
             $errors['email'] = __('validation.unique', ['attribute' => 'email']);
55 55
         }
56
-        $validator->after(function () use ($validator, $errors) {
56
+        $validator->after(function() use ($validator, $errors) {
57 57
             foreach ($errors as $field => $error) {
58 58
                 $validator->errors()->add($field, $error);
59 59
             }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Ports/UserRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 
9 9
 interface UserRepository
10 10
 {
11
-    public function getByEmail(string $email):? User;
12
-    public function getById(string $id):?User;
13
-    public function getByProvider(string $provider, string $providerId):?User;
11
+    public function getByEmail(string $email): ? User;
12
+    public function getById(string $id): ?User;
13
+    public function getByProvider(string $provider, string $providerId): ?User;
14 14
     public function search(string $organizationId, int $page, int $perPage = 10): array;
15 15
     public function add(User $u, string $password = null);
16 16
     public function update(User $u);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Auth/RegisterUserAfterErrorWithSocialNetwork.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
      */
90 90
     private function checkProviderAllowed(?string $provider, ?string $providerId): void
91 91
     {
92
-        if($provider === null || $providerId === null){
92
+        if ($provider === null || $providerId === null) {
93 93
             throw new ProviderMissing();
94 94
         }
95 95
         if (!in_array($provider, $this->allowedProviders)) {
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Auth/Services/CheckEmailUniqueness.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         $user = $this->userRepository->getByEmail($email);
22 22
         if (isset($user)) {
23 23
             $errors['email'] = __('validation.unique', ['attribute' => 'email']);
24
-            $validator->after(function () use ($validator, $errors) {
24
+            $validator->after(function() use ($validator, $errors) {
25 25
                 foreach ($errors as $field => $error) {
26 26
                     $validator->errors()->add($field, $error);
27 27
                 }
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Sql/InvitationRepositorySql.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
             ->select()
30 30
             ->where('hash', $hash)
31 31
             ->first();
32
-        if(!isset($record)){
32
+        if (!isset($record)) {
33 33
             return null;
34 34
         }
35 35
         return new Invitation($record->organization_id, $record->email, $record->firstname, $record->lastname);
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Ports/InvitationRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,5 +9,5 @@
 block discarded – undo
9 9
 interface InvitationRepository
10 10
 {
11 11
     public function add(Invitation $i);
12
-    public function getByHash(string $hash):?Invitation;
12
+    public function getByHash(string $hash): ?Invitation;
13 13
 }
Please login to merge, or discard this patch.