Test Setup Failed
Branch user/international-postal-code... (b53ac3)
by Bertrand
08:58
created
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/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.
app/Src/UseCases/Domain/Ports/ContextRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
 
10 10
 interface ContextRepository
11 11
 {
12
-    public function getByUser(string $userId):?Context;
12
+    public function getByUser(string $userId): ?Context;
13 13
     public function add(Context $context, string $userId);
14 14
     public function update(Context $context, string $userId);
15
-    public function getByUserDto(string $userId):?ContextDto;
15
+    public function getByUserDto(string $userId): ?ContextDto;
16 16
 }
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Sql/CharacteristicsRepositorySql.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
         return $list->toArray();
32 32
     }
33 33
 
34
-    public function getByPageId(int $pageId):?Characteristic
34
+    public function getByPageId(int $pageId): ?Characteristic
35 35
     {
36 36
         $c = CharacteristicsModel::query()
37 37
             ->where('page_id', $pageId)
38 38
             ->first();
39
-        if(!isset($c)){
39
+        if (!isset($c)) {
40 40
             return null;
41 41
         }
42 42
         return $c->toDomain();
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
     public function getBy(array $conditions): ?Characteristic
63 63
     {
64 64
         $characteristicModel = CharacteristicsModel::query()
65
-            ->when(isset($conditions['type']), function ($query) use($conditions){
65
+            ->when(isset($conditions['type']), function($query) use($conditions){
66 66
                 $query->where('type', $conditions['type']);
67 67
             })
68
-            ->when(isset($conditions['title']), function ($query) use($conditions){
68
+            ->when(isset($conditions['title']), function($query) use($conditions){
69 69
                 $query->where('code', $conditions['title']);
70 70
             })
71 71
             ->first();
72
-        if(!isset($characteristicModel)){
72
+        if (!isset($characteristicModel)) {
73 73
             return null;
74 74
         }
75 75
         return $characteristicModel->toDomain();
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/UseCases/AddCharacteristicsToContext.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
         $pages = $this->pageRepository->getByIds($pagesIds);
37 37
 
38 38
         $characteristics = [];
39
-        foreach ($pages as $page){
39
+        foreach ($pages as $page) {
40 40
             $characteristic = $this->characteristicsRepository->getByPageId($page->pageId());
41
-            if(!isset($characteristic)){
41
+            if (!isset($characteristic)) {
42 42
                 $characteristic = $page->createCharacteristicAssociated();
43 43
             }
44 44
             $characteristics[] = $characteristic->id();
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Context/Queries/GetContextByUser.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/Shared/Model/Dto.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         foreach ($properties as $key => $property){
17 17
             if(is_object($property)){
18 18
                 $params[$this->camelToSnake($key)] = $this->serialize(get_object_vars($property));
19
-            }else {
19
+            } else {
20 20
                 $params[$this->camelToSnake($key)] = $property;
21 21
             }
22 22
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
     private function serialize(array $properties)
15 15
     {
16 16
         $params = [];
17
-        foreach ($properties as $key => $property){
18
-            if(is_object($property)){
17
+        foreach ($properties as $key => $property) {
18
+            if (is_object($property)) {
19 19
                 $params[$this->camelToSnake($key)] = $this->serialize(get_object_vars($property));
20
-            }else {
20
+            } else {
21 21
                 $params[$this->camelToSnake($key)] = $property;
22 22
             }
23 23
         }
Please login to merge, or discard this patch.
app/Http/Middleware/IsWizardProfileAvailable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public function handle($request, \Closure $next)
12 12
     {
13 13
         $user = Auth::user();
14
-        if($user->context_id === null){
14
+        if ($user->context_id === null) {
15 15
             return $next($request);
16 16
         }
17 17
         return redirect('/profile');
Please login to merge, or discard this patch.
app/Http/Middleware/FlashWikiCallback.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@
 block discarded – undo
15 15
      */
16 16
     public function handle($request, Closure $next)
17 17
     {
18
-        if(session()->has('wiki_callback')){
18
+        if (session()->has('wiki_callback')) {
19 19
             session()->keep(['wiki_callback', 'wiki_token']);
20 20
         }
21 21
 
22
-        if($request->has('sso')){
22
+        if ($request->has('sso')) {
23 23
             session()->put('sso', $request->get('sso'));
24 24
             session()->put('sig', $request->get('sig'));
25 25
         }
Please login to merge, or discard this patch.