Test Failed
Pull Request — master (#78)
by guillaume
07:31
created
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.
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/Domain/System/GetDepartmentFromPostalCodeImpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         $content = json_decode($response->getBody()->getContents(), true);
24 24
 
25 25
         $features = $content['features'];
26
-        if(isset($features) && !empty($features)){
26
+        if (isset($features) && !empty($features)) {
27 27
             $feature = $features[0];
28 28
             $coordinates = $feature['geometry']['coordinates'];
29 29
             $departmentNumber = explode(',', $feature['properties']['context'])[0];
Please login to merge, or discard this patch.
app/Src/UseCases/Infra/Sql/ContextRepositorySql.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 class ContextRepositorySql implements ContextRepository
14 14
 {
15
-    public function getByUser(string $userId):?Context
15
+    public function getByUser(string $userId): ?Context
16 16
     {
17 17
         $user = User::where('uuid', $userId)->first();
18 18
         return $user->context !== null ? $user->context->toDomain() : null;
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function getByUserDto(string $userId): ?ContextDto
36 36
     {
37 37
         $user = User::where('uuid', $userId)->first();
38
-        if($user === null){
38
+        if ($user === null) {
39 39
             return null;
40 40
         }
41 41
         return $user->context !== null ? $user->context->toDto($user->uuid) : null;
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
     public function update(Context $context, string $userId)
45 45
     {
46 46
         $user = User::where('uuid', $userId)->first();
47
-        if($user === null){
47
+        if ($user === null) {
48 48
             return null;
49 49
         }
50 50
 
51 51
         $contextModel = $user->context;
52
-        if($contextModel === null){
52
+        if ($contextModel === null) {
53 53
             return null;
54 54
         }
55 55
         $contextData = collect($context->toArray());
Please login to merge, or discard this patch.
app/User.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function adminlte_image()
38 38
     {
39 39
         $urlPicture = $this->path_picture != "" ? asset('storage/'.str_replace('app/public/', '', $this->path_picture)) : null;
40
-        if(!isset($urlPicture) || $urlPicture === ""){
40
+        if (!isset($urlPicture) || $urlPicture === "") {
41 41
             $urlPicture = url('').'/'.config('adminlte.logo_img');
42 42
         }
43 43
         return $urlPicture;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function adminlte_desc()
47 47
     {
48 48
         $desc = $this->firstname.' '.$this->lastname;
49
-        if($this->organization_id !== null){
49
+        if ($this->organization_id !== null) {
50 50
             $organization = app(OrganizationRepository::class)->get($this->organization_id);
51 51
             $desc .= ' - organisme : '.$organization->name();
52 52
         }
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 
86 86
     public function addCharacteristics(array $characteristics)
87 87
     {
88
-        foreach($characteristics as $characteristicUuid){
89
-            $characteristic = CharacteristicsModel::where('uuid', (string)$characteristicUuid)->first();
90
-            if(isset($characteristic)) {
88
+        foreach ($characteristics as $characteristicUuid) {
89
+            $characteristic = CharacteristicsModel::where('uuid', (string) $characteristicUuid)->first();
90
+            if (isset($characteristic)) {
91 91
                 $this->characteristics()->save($characteristic);
92 92
             }
93 93
         }
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
     public function syncCharacteristics(array $characteristics)
97 97
     {
98 98
         $characteristicsToSync = [];
99
-        foreach($characteristics as $characteristicUuid){
100
-            $characteristicModel = CharacteristicsModel::where('uuid', (string)$characteristicUuid)->first();
101
-            if(isset($characteristicModel)) {
99
+        foreach ($characteristics as $characteristicUuid) {
100
+            $characteristicModel = CharacteristicsModel::where('uuid', (string) $characteristicUuid)->first();
101
+            if (isset($characteristicModel)) {
102 102
                 $characteristicsToSync[] = $characteristicModel->id;
103 103
             }
104 104
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Profile/WizardProfileController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         $farmingType = $request->input('farming_type') !== null ? $request->input('farming_type') : [];
45 45
 
46 46
         $fillWikiUserProfile->fill(Auth::user()->uuid, $role, $firstname, $lastname, $email, $postalCode, $farmingType);
47
-        if(session()->has('wiki_callback')){
47
+        if (session()->has('wiki_callback')) {
48 48
             return $this->redirectToWiki();
49 49
         }
50 50
         return redirect(config('neayi.wiki_url'));
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Shared/Model/Dto.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@
 block discarded – undo
13 13
 
14 14
     private function toArray(array $properties)
15 15
     {
16
-        foreach ($properties as $key => $property){
17
-            if(is_object($property)){
16
+        foreach ($properties as $key => $property) {
17
+            if (is_object($property)) {
18 18
                 $params[$this->camelToSnake($key)] = $this->toArray(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.
app/Src/UseCases/Domain/Context/Dto/ContextDto.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         $this->department = $departmentNumber;
41 41
         $this->fullname = $this->fullname();
42 42
         $characteristicsByType = [];
43
-        foreach($characteristics as $characteristic){
43
+        foreach ($characteristics as $characteristic) {
44 44
             $characteristicsByType[$characteristic->type()][] = $characteristic;
45 45
         }
46 46
 
Please login to merge, or discard this patch.