Passed
Push — main ( c808ff...4e47c4 )
by Jonathan
13:05
created
app/Module/GeoDispersion/Http/RequestHandlers/AdminConfigPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
             throw new HttpAccessDeniedException();
88 88
         }
89 89
 
90
-        return $this->viewResponse($this->module->name() . '::admin/config', [
90
+        return $this->viewResponse($this->module->name().'::admin/config', [
91 91
             'module_name'       =>  $this->module->name(),
92 92
             'title'             =>  $this->module->title(),
93 93
             'tree'              =>  $tree,
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Views/AbstractGeoAnalysisView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
      */
112 112
     public function detailedTabContent(ModuleInterface $module, Collection $results, array $params): string
113 113
     {
114
-        return view($module->name() . '::geoanalysisview-tab-detailed', $params + [ 'results'   =>  $results ]);
114
+        return view($module->name().'::geoanalysisview-tab-detailed', $params + ['results'   =>  $results]);
115 115
     }
116 116
 
117 117
     /**
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Schema/Migration2.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         foreach ($existing_views as $old_view) {
93 93
             try {
94
-                $tree = $tree_service->find((int) $old_view->majgd_file);
94
+                $tree = $tree_service->find((int)$old_view->majgd_file);
95 95
             } catch (RuntimeException $ex) {
96 96
                 continue;
97 97
             }
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
             $old_view->majgd_status === 'enabled',
135 135
             $old_view->majgd_descr,
136 136
             app(SosaByGenerationGeoAnalysis::class),
137
-            (int) $old_view->majgd_sublevel,
138
-            (int) $old_view->majgd_detailsgen
137
+            (int)$old_view->majgd_sublevel,
138
+            (int)$old_view->majgd_detailsgen
139 139
         );
140 140
 
141 141
         return $geoview_data_service->insertGetId($new_view) > 0;
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
             $old_view->majgd_status === 'enabled',
166 166
             $old_view->majgd_descr,
167 167
             app(SosaByGenerationGeoAnalysis::class),
168
-            (int) $old_view->majgd_sublevel,
169
-            (int) $old_view->majgd_detailsgen
168
+            (int)$old_view->majgd_sublevel,
169
+            (int)$old_view->majgd_detailsgen
170 170
         );
171 171
 
172 172
         $view_id = $geoview_data_service->insertGetId($new_view);
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     private function mapIdsFromOld(string $map_xml): array
204 204
     {
205 205
         $mapping = self::MAPS_XML_MAPPING[$map_xml] ?? [];
206
-        return is_array($mapping) ? $mapping : [ $mapping ];
206
+        return is_array($mapping) ? $mapping : [$mapping];
207 207
     }
208 208
 
209 209
     /**
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Services/GeoAnalysisViewDataService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function find(Tree $tree, int $id, bool $include_disabled = false): ?AbstractGeoAnalysisView
43 43
     {
44 44
         return $this->all($tree, $include_disabled)
45
-            ->first(fn(AbstractGeoAnalysisView $view): bool => $view->id() === $id);
45
+            ->first(fn(AbstractGeoAnalysisView $view) : bool => $view->id() === $id);
46 46
     }
47 47
 
48 48
     /**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         return Registry::cache()->array()->remember(
60 60
             'all-geodispersion-views',
61
-            function () use ($tree, $include_disabled): Collection {
61
+            function() use ($tree, $include_disabled): Collection {
62 62
                 return DB::table('maj_geodisp_views')
63 63
                     ->select('maj_geodisp_views.*')
64 64
                     ->where('majgv_gedcom_id', '=', $tree->id())
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     private function viewMapper(Tree $tree): Closure
150 150
     {
151
-        return function (stdClass $row) use ($tree): ?AbstractGeoAnalysisView {
151
+        return function(stdClass $row) use ($tree): ?AbstractGeoAnalysisView {
152 152
             try {
153 153
                 $geoanalysis = app($row->majgv_analysis);
154 154
                 if (!($geoanalysis instanceof GeoAnalysisInterface)) {
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
                 }
157 157
 
158 158
                 $view = app()->makeWith($row->majgv_view_class, [
159
-                    'id'                    =>  (int) $row->majgv_id,
159
+                    'id'                    =>  (int)$row->majgv_id,
160 160
                     'tree'                  =>  $tree,
161 161
                     'enabled'               =>  $row->majgv_status === 'enabled',
162 162
                     'description'           =>  $row->majgv_descr,
163 163
                     'geoanalysis'           =>  $geoanalysis,
164
-                    'depth'                 =>  (int) $row->majgv_place_depth,
165
-                    'detailed_top_places'   =>  (int) $row->majgv_top_places
164
+                    'depth'                 =>  (int)$row->majgv_place_depth,
165
+                    'detailed_top_places'   =>  (int)$row->majgv_top_places
166 166
                 ]);
167 167
 
168 168
                 if ($row->majgv_colors !== null && $view instanceof GeoAnalysisMap) {
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      */
211 211
     private function enabledFilter(bool $include_disabled): Closure
212 212
     {
213
-        return function (AbstractGeoAnalysisView $view) use ($include_disabled): bool {
213
+        return function(AbstractGeoAnalysisView $view) use ($include_disabled): bool {
214 214
             return $include_disabled || $view->isEnabled();
215 215
         };
216 216
     }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Services/PlacesReferenceTableService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
         if ($source_parts === false) {
50 50
             return null;
51 51
         }
52
-        $source_parts = array_map(function (string $part): string {
52
+        $source_parts = array_map(function(string $part): string {
53 53
             if (preg_match('/^#([^#]+)#$/i', $part, $column_id) === 1) {
54 54
                 return $this->columnName($column_id[1]);
55 55
             }
56 56
             return $this->sanitizeString(str_replace(['?', '*'], ['_', '%'], $part));
57 57
         }, array_filter($source_parts));
58 58
         $source_parts[] = "'%'";
59
-        $concat_statement = 'CONCAT(' . implode(', ', $source_parts) . ')';
59
+        $concat_statement = 'CONCAT('.implode(', ', $source_parts).')';
60 60
 
61 61
         // Extract columns used in target
62 62
         $columns = [];
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         // Get the mapping
68 68
         $rows = DB::table('maj_geodata_ref')  //DB::table('maj_geodata_ref')
69 69
             ->select($columns)
70
-            ->whereRaw($this->sanitizeString($source) . " LIKE " . $concat_statement)
70
+            ->whereRaw($this->sanitizeString($source)." LIKE ".$concat_statement)
71 71
             ->get();
72 72
 
73 73
         // Format the output ID
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
             return null;
76 76
         }
77 77
 
78
-        $mapping = (array) $rows->first();
78
+        $mapping = (array)$rows->first();
79 79
         if (count($columns_select) === 0) {
80 80
             return $target_format;
81 81
         }
82 82
 
83 83
         return str_replace(
84
-            array_map(fn($tag) => '{' . $tag . '}', $columns_select[1]),
84
+            array_map(fn($tag) => '{'.$tag.'}', $columns_select[1]),
85 85
             array_map(fn($tag) => $mapping[$this->columnName($tag)] ?? '', $columns_select[1]),
86 86
             $target_format
87 87
         );
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Services/MapAdapterDataService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     private function mapAdapterMapper(): Closure
134 134
     {
135
-        return function (stdClass $row): ?GeoAnalysisMapAdapter {
135
+        return function(stdClass $row): ?GeoAnalysisMapAdapter {
136 136
             if (null === $map = $this->mapdefinition_service->find($row->majgm_map_id)) {
137 137
                 return null;
138 138
             }
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
                 }
144 144
 
145 145
                 return new GeoAnalysisMapAdapter(
146
-                    (int) $row->majgm_id,
147
-                    (int) $row->majgm_majgv_id,
146
+                    (int)$row->majgm_id,
147
+                    (int)$row->majgm_majgv_id,
148 148
                     $map,
149 149
                     app($row->majgm_mapper),
150 150
                     new MapViewConfig($row->majgm_feature_prop, $this->mapperConfigDecoder($row->majgm_config))
Please login to merge, or discard this patch.
app/Module/GeoDispersion/PlaceMappers/CoordinatesPlaceMapper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         if ($cacheKey === null) {
126 126
             return null;
127 127
         }
128
-        return Registry::cache()->array()->remember($cacheKey, function (): ?array {
128
+        return Registry::cache()->array()->remember($cacheKey, function(): ?array {
129 129
             $map_def = $this->data('map');
130 130
             if (
131 131
                 !$this->setGeometryEngine()
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             if ($map_def === null || !($map_def instanceof MapDefinitionInterface)) {
202 202
                 return null;
203 203
             }
204
-            return spl_object_id($this) . '-map-' . $map_def->id();
204
+            return spl_object_id($this).'-map-'.$map_def->id();
205 205
         }
206 206
         return $this->cache_key;
207 207
     }
Please login to merge, or discard this patch.
app/Module/Certificates/CertificatesModule.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function loadRoutes($router): void
104 104
     {
105
-        $router->attach('', '', static function (Map $router): void {
105
+        $router->attach('', '', static function(Map $router): void {
106 106
 
107
-            $router->attach('', '/module-maj/certificates', static function (Map $router): void {
107
+            $router->attach('', '/module-maj/certificates', static function(Map $router): void {
108 108
 
109
-                $router->attach('', '/admin', static function (Map $router): void {
109
+                $router->attach('', '/admin', static function(Map $router): void {
110 110
 
111 111
                     $router->get(AdminConfigPage::class, '/config{/tree}', AdminConfigPage::class);
112 112
                     $router->post(AdminConfigAction::class, '/config/{tree}', AdminConfigAction::class)
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                         'permission_preference' =>  'MAJ_CERTIF_SHOW_CERT'
130 130
                     ]);
131 131
 
132
-                $router->attach('', '/certificate/{tree}/{cid}', static function (Map $router): void {
132
+                $router->attach('', '/certificate/{tree}/{cid}', static function(Map $router): void {
133 133
 
134 134
                     $router->extras([
135 135
                         'middleware'            =>  [AuthTreePreference::class],
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public function headContent(): string
169 169
     {
170
-        return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">';
170
+        return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">';
171 171
     }
172 172
 
173 173
     /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public function listUrl(Tree $tree, array $parameters = []): string
178 178
     {
179
-        return route(CertificatesList::class, ['tree' => $tree->name() ] + $parameters);
179
+        return route(CertificatesList::class, ['tree' => $tree->name()] + $parameters);
180 180
     }
181 181
 
182 182
     /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      */
195 195
     public function listIsEmpty(Tree $tree): bool
196 196
     {
197
-        return Auth::accessLevel($tree) > (int) $tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string) Auth::PRIV_HIDE);
197
+        return Auth::accessLevel($tree) > (int)$tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string)Auth::PRIV_HIDE);
198 198
     }
199 199
 
200 200
     /**
Please login to merge, or discard this patch.
app/Module/Certificates/Http/RequestHandlers/CertificatesList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         $title = I18N::translate('Certificates');
81 81
 
82
-        $cities = array_map(function (string $item): array {
82
+        $cities = array_map(function(string $item): array {
83 83
             return [$this->url_obfuscator_service->obfuscate($item), $item];
84 84
         }, $this->certif_filesystem->cities($tree));
85 85
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $certificates = $this->certif_filesystem->certificatesForCity($tree, $city);
91 91
         }
92 92
 
93
-        return $this->viewResponse($this->module->name() . '::certificates-list', [
93
+        return $this->viewResponse($this->module->name().'::certificates-list', [
94 94
             'title'                     =>  $title,
95 95
             'tree'                      =>  $tree,
96 96
             'module_name'               =>  $this->module->name(),
Please login to merge, or discard this patch.