Passed
Push — main ( f9aaf7...4197a4 )
by Jonathan
14:34
created
Module/GeoDispersion/PlaceMappers/Config/FilteredTopPlaceMapperConfig.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     {
63 63
         return [
64 64
             'topPlaces' => $this->topPlaces()
65
-                ->map(fn(Place $place): array => [ $place->tree()->id(), $place->gedcomName() ])
65
+                ->map(fn(Place $place): array => [$place->tree()->id(), $place->gedcomName()])
66 66
                 ->toArray()
67 67
         ];
68 68
     }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                     ->filter(
83 83
                         /** @psalm-suppress MissingClosureParamType */
84 84
                         fn($item): bool => is_array($item) && count($item) == 2
85
-                    )->map(function (array $item): ?Place {
85
+                    )->map(function(array $item): ?Place {
86 86
                         try {
87 87
                             return new Place($item[1], $this->tree_service->find($item[0]));
88 88
                         } catch (RuntimeException $ex) {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function configContent(ModuleInterface $module, Tree $tree): string
104 104
     {
105
-        return view($module->name() . '::mappers/filtered-top-config', [
105
+        return view($module->name().'::mappers/filtered-top-config', [
106 106
             'tree'          =>  $tree,
107 107
             'top_places'    =>  $this->topPlaces()
108 108
         ]);
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
             return $this;
120 120
         }
121 121
 
122
-        $params = (array) $request->getParsedBody();
122
+        $params = (array)$request->getParsedBody();
123 123
 
124 124
         $top_places = $params['mapper_filt_top_places'] ?? [];
125 125
         if (is_array($top_places)) {
126 126
             $config = ['topPlaces' => []];
127 127
             foreach ($top_places as $top_place_id) {
128
-                $place = Place::find((int) $top_place_id, $tree);
128
+                $place = Place::find((int)$top_place_id, $tree);
129 129
                 if (mb_strlen($place->gedcomName()) > 0) {
130 130
                     $config['topPlaces'][] = $place;
131 131
                 }
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/GeoDispersion/Model/GeoAnalysisMapAdapter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                     ->withProperty(
124 124
                         'places',
125 125
                         $feature_data->places()
126
-                            ->map(fn(GeoAnalysisPlace $place): string => $place->place()->firstParts(1)->first())
126
+                            ->map(fn(GeoAnalysisPlace $place) : string => $place->place()->firstParts(1)->first())
127 127
                             ->sort(I18N::comparator())
128 128
                             ->toArray()
129 129
                     );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $features_data
136 136
             ->filter(fn(MapFeatureAnalysisData $data) => !$data->existsInMap())
137 137
             ->each(
138
-                fn (MapFeatureAnalysisData $data) =>
138
+                fn(MapFeatureAnalysisData $data) =>
139 139
                     $data->places()->each(
140 140
                         fn(GeoAnalysisPlace $place) => $result->exclude($place)
141 141
                     )
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $features_mapping = new Collection();
156 156
 
157 157
         $byplaces = $result->knownPlaces();
158
-        $byplaces->each(function (GeoAnalysisResultItem $item) use ($features_mapping, $result): void {
158
+        $byplaces->each(function(GeoAnalysisResultItem $item) use ($features_mapping, $result): void {
159 159
             $id = $this->place_mapper->map($item->place()->place(), $this->config->mapMappingProperty());
160 160
 
161 161
             if ($id !== null && mb_strlen($id) > 0) {
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             }
169 169
         });
170 170
 
171
-        return [ $features_mapping, $result];
171
+        return [$features_mapping, $result];
172 172
     }
173 173
 
174 174
     /**
Please login to merge, or discard this patch.
app/Module/Certificates/Hooks/SourceCertificateIconHook.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,10 +59,10 @@
 block discarded – undo
59 59
     {
60 60
         $permission_level = $tree->getPreference('MAJ_CERTIF_SHOW_CERT');
61 61
         if (
62
-            is_numeric($permission_level) && Auth::accessLevel($tree) <= (int) $permission_level &&
63
-            preg_match('/^' . $level . ' _ACT (.*)$/m', $source_record, $match) === 1
62
+            is_numeric($permission_level) && Auth::accessLevel($tree) <= (int)$permission_level &&
63
+            preg_match('/^'.$level.' _ACT (.*)$/m', $source_record, $match) === 1
64 64
         ) {
65
-            return view($this->module->name() . '::components/certificate-icon', [
65
+            return view($this->module->name().'::components/certificate-icon', [
66 66
                 'module_name'               =>  $this->module->name(),
67 67
                 'certificate'               =>  new Certificate($tree, $match[1]),
68 68
                 'url_obfuscator_service'    =>  $this->url_obfuscator_service,
Please login to merge, or discard this patch.
app/Module/Certificates/Hooks/CertificateTagEditorHook.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     public function addExpectedTags(array $expected_tags): array
53 53
     {
54 54
         return array_merge_recursive($expected_tags, [
55
-            'SOUR' => [ '_ACT' ]
55
+            'SOUR' => ['_ACT']
56 56
         ]);
57 57
     }
58 58
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function getLabel(string $tag): string
64 64
     {
65 65
         if (substr($tag, -4) === '_ACT') {
66
-            return Registry::elementFactory()->make(substr('INDI:SOUR:_ACT', 0, -strlen($tag)) . $tag)->label();
66
+            return Registry::elementFactory()->make(substr('INDI:SOUR:_ACT', 0, -strlen($tag)).$tag)->label();
67 67
         }
68 68
         return '';
69 69
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function editForm(string $tag, string $id, string $name, string $value, Tree $tree): string
76 76
     {
77 77
         if (substr($tag, -4) === '_ACT') {
78
-            return Registry::elementFactory()->make(substr('INDI:SOUR:_ACT', 0, -strlen($tag)) . $tag)
78
+            return Registry::elementFactory()->make(substr('INDI:SOUR:_ACT', 0, -strlen($tag)).$tag)
79 79
                 ->edit($id, $name, $value, $tree);
80 80
         }
81 81
         return '';
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/AdminConfigAction.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
             return redirect($admin_config_route);
64 64
         }
65 65
 
66
-        $params = (array) $request->getParsedBody();
66
+        $params = (array)$request->getParsedBody();
67 67
 
68
-        $tree->setPreference('MAJ_CERTIF_SHOW_CERT', $params['MAJ_CERTIF_SHOW_CERT'] ?? (string) Auth::PRIV_HIDE);
68
+        $tree->setPreference('MAJ_CERTIF_SHOW_CERT', $params['MAJ_CERTIF_SHOW_CERT'] ?? (string)Auth::PRIV_HIDE);
69 69
         $tree->setPreference(
70 70
             'MAJ_CERTIF_SHOW_NO_WATERMARK',
71
-            $params['MAJ_CERTIF_SHOW_NO_WATERMARK'] ?? (string) Auth::PRIV_HIDE
71
+            $params['MAJ_CERTIF_SHOW_NO_WATERMARK'] ?? (string)Auth::PRIV_HIDE
72 72
         );
73 73
         $tree->setPreference('MAJ_CERTIF_WM_DEFAULT', $params['MAJ_CERTIF_WM_DEFAULT'] ?? '');
74 74
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         // Only accept valid folders for MAJ_CERT_ROOTDIR
87 87
         $cert_root_dir = $params['MAJ_CERTIF_ROOTDIR'] ?? '';
88 88
         $cert_root_dir = preg_replace('/[:\/\\\\]+/', '/', $cert_root_dir);
89
-        $cert_root_dir = trim($cert_root_dir, '/') . '/';
89
+        $cert_root_dir = trim($cert_root_dir, '/').'/';
90 90
         $tree->setPreference('MAJ_CERTIF_ROOTDIR', $cert_root_dir);
91 91
 
92 92
         FlashMessages::addMessage(
Please login to merge, or discard this patch.
app/Module/Certificates/Http/RequestHandlers/CertificateImage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         if ($certificate === null) {
106 106
             return $this->certif_image_factory
107
-            ->replacementImageResponse((string) StatusCodeInterface::STATUS_NOT_FOUND)
107
+            ->replacementImageResponse((string)StatusCodeInterface::STATUS_NOT_FOUND)
108 108
             ->withHeader('X-Image-Exception', I18N::translate('The certificate was not found in this family tree.'))
109 109
             ;
110 110
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $size = $certificate->tree()->getPreference('MAJ_CERTIF_WM_FONT_MAXSIZE');
133 133
         $text = $this->watermarkText($request, $certificate);
134 134
 
135
-        return new Watermark($text, $color, is_numeric($size) ? (int) $size : Watermark::DEFAULT_SIZE);
135
+        return new Watermark($text, $color, is_numeric($size) ? (int)$size : Watermark::DEFAULT_SIZE);
136 136
     }
137 137
 
138 138
     /**
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.