@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $module_name = $this->module->name(); |
71 | 71 | return response(['data' => $this->geoview_data_service->all($tree, true) |
72 | 72 | ->map(fn(AbstractGeoAnalysisView $view) => [ |
73 | - "edit" => view($module_name . '::admin/view-table-options', [ |
|
73 | + "edit" => view($module_name.'::admin/view-table-options', [ |
|
74 | 74 | 'view_id' => $view->id(), |
75 | 75 | 'view_enabled' => $view->isEnabled(), |
76 | 76 | 'view_edit_route' => route(GeoAnalysisViewEditPage::class, [ |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | ]), |
89 | 89 | ]), |
90 | 90 | "enabled" => [ |
91 | - 'display' => view($module_name . '::components/yes-no-icons', ['yes' => $view->isEnabled()]), |
|
91 | + 'display' => view($module_name.'::components/yes-no-icons', ['yes' => $view->isEnabled()]), |
|
92 | 92 | 'raw' => $view->isEnabled() ? 0 : 1 |
93 | 93 | ], |
94 | 94 | "type" => $view->icon($module), |
95 | 95 | "description" => [ |
96 | - 'display' => '<span dir="auto">' . e($view->description()) . '</span>', |
|
96 | + 'display' => '<span dir="auto">'.e($view->description()).'</span>', |
|
97 | 97 | 'raw' => e($view->description()) |
98 | 98 | ], |
99 | 99 | "analysis" => [ |
100 | - 'display' => '<span dir="auto">' . e($view->analysis()->title()) . '</span>', |
|
100 | + 'display' => '<span dir="auto">'.e($view->analysis()->title()).'</span>', |
|
101 | 101 | 'raw' => e($view->analysis()->title()) |
102 | 102 | ], |
103 | 103 | "place_depth" => [ |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $map_id = $request->getQueryParams()['map_id'] ?? $request->getAttribute('map_id') ?? ''; |
52 | 52 | |
53 | - return response(Registry::cache()->file()->remember('map-properties-' . $map_id, function () use ($map_id) { |
|
53 | + return response(Registry::cache()->file()->remember('map-properties-'.$map_id, function() use ($map_id) { |
|
54 | 54 | $map = $this->map_definition_service->find($map_id); |
55 | 55 | if ($map === null) { |
56 | 56 | throw new HttpNotFoundException(I18N::translate('The map could not be found.')); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ->map(fn(Feature $feature): ?stdClass => $feature->getProperties()) |
62 | 62 | ->filter() |
63 | 63 | ->map(fn(stdClass $properties) => array_keys(get_object_vars($properties))) |
64 | - ->each(function (array $properties) use (&$features) { |
|
64 | + ->each(function(array $properties) use (&$features) { |
|
65 | 65 | $features = count($features) === 0 ? $properties : array_intersect($features, $properties); |
66 | 66 | }); |
67 | 67 |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | return redirect(route(AdminConfigPage::class, ['tree' => $tree])); |
74 | 74 | } |
75 | 75 | |
76 | - $adapter_id = (int) $request->getAttribute('adapter_id'); |
|
76 | + $adapter_id = (int)$request->getAttribute('adapter_id'); |
|
77 | 77 | $map_adapter = $this->mapadapter_data_service->find($adapter_id); |
78 | 78 | |
79 | - $params = (array) $request->getParsedBody(); |
|
79 | + $params = (array)$request->getParsedBody(); |
|
80 | 80 | |
81 | 81 | $map = $this->map_definition_service->find($params['map_adapter_map'] ?? ''); |
82 | - $mapping_property = $params['map_adapter_property_selected'] ?? ''; |
|
82 | + $mapping_property = $params['map_adapter_property_selected'] ?? ''; |
|
83 | 83 | |
84 | 84 | $mapper = null; |
85 | 85 | try { |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | 'success' |
104 | 104 | ); |
105 | 105 | //phpcs:ignore Generic.Files.LineLength.TooLong |
106 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Map Adapter “' . $map_adapter->id() . '” has been updated.'); |
|
106 | + Log::addConfigurationLog('Module '.$this->module->title().' : Map Adapter “'.$map_adapter->id().'” has been updated.'); |
|
107 | 107 | } else { |
108 | 108 | FlashMessages::addMessage( |
109 | 109 | I18N::translate('An error occured while updating the map configuration'), |
110 | 110 | 'danger' |
111 | 111 | ); |
112 | 112 | //phpcs:ignore Generic.Files.LineLength.TooLong |
113 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Map Adapter “' . $map_adapter->id() . '” could not be updated. See error log.'); |
|
113 | + Log::addConfigurationLog('Module '.$this->module->title().' : Map Adapter “'.$map_adapter->id().'” could not be updated. See error log.'); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return redirect(route(GeoAnalysisViewEditPage::class, [ |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function icon(ModuleInterface $module): string |
38 | 38 | { |
39 | - return view($module->name() . '::icons/view-table', ['type' => $this->type()]); |
|
39 | + return view($module->name().'::icons/view-table', ['type' => $this->type()]); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function globalTabContent(ModuleInterface $module, GeoAnalysisResult $result, array $params): string |
65 | 65 | { |
66 | - return view($module->name() . '::geoanalysisview-tab-glb-table', $params + [ |
|
66 | + return view($module->name().'::geoanalysisview-tab-glb-table', $params + [ |
|
67 | 67 | 'result' => $result |
68 | 68 | ]); |
69 | 69 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function icon(ModuleInterface $module): string |
44 | 44 | { |
45 | - return view($module->name() . '::icons/view-map', ['type' => $this->type()]); |
|
45 | + return view($module->name().'::icons/view-map', ['type' => $this->type()]); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function globalSettingsContent(ModuleInterface $module): string |
53 | 53 | { |
54 | - return view($module->name() . '::admin/view-edit-map', [ |
|
54 | + return view($module->name().'::admin/view-edit-map', [ |
|
55 | 55 | 'module_name' => $module->name(), |
56 | 56 | 'view' => $this, |
57 | 57 | 'colors' => $this->colors(), |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function withGlobalSettingsUpdate(ServerRequestInterface $request): self |
67 | 67 | { |
68 | - $params = (array) $request->getParsedBody(); |
|
68 | + $params = (array)$request->getParsedBody(); |
|
69 | 69 | |
70 | 70 | $default_color = $params['view_map_color_default'] ?? ''; |
71 | 71 | $stroke_color = $params['view_map_color_stroke'] ?? ''; |
72 | - $maxvalue_color = $params['view_map_color_maxvalue'] ?? ''; |
|
73 | - $hover_color = $params['view_map_color_hover'] ?? ''; |
|
72 | + $maxvalue_color = $params['view_map_color_maxvalue'] ?? ''; |
|
73 | + $hover_color = $params['view_map_color_hover'] ?? ''; |
|
74 | 74 | |
75 | 75 | try { |
76 | 76 | return $this->withColors(new MapColorsConfig( |
@@ -97,12 +97,11 @@ discard block |
||
97 | 97 | foreach ($map_adapters as $map_adapter) { |
98 | 98 | $adapter_result_tmp = $map_adapter->convert($result); |
99 | 99 | $adapter_result = $adapter_result === null ? |
100 | - $adapter_result_tmp : |
|
101 | - $adapter_result->merge($adapter_result_tmp); |
|
100 | + $adapter_result_tmp : $adapter_result->merge($adapter_result_tmp); |
|
102 | 101 | } |
103 | 102 | |
104 | 103 | if ($adapter_result === null) { |
105 | - return view($module->name() . '::errors/tab-error', [ |
|
104 | + return view($module->name().'::errors/tab-error', [ |
|
106 | 105 | 'message' => I18N::translate('The map could not be loaded.'), |
107 | 106 | ]); |
108 | 107 | } |
@@ -117,7 +116,7 @@ discard block |
||
117 | 116 | ]; |
118 | 117 | //phpcs:enable |
119 | 118 | |
120 | - return view($module->name() . '::geoanalysisview-tab-glb-map', $params + [ |
|
119 | + return view($module->name().'::geoanalysisview-tab-glb-map', $params + [ |
|
121 | 120 | 'result' => $adapter_result->geoAnalysisResult(), |
122 | 121 | 'features' => $adapter_result->features(), |
123 | 122 | 'colors' => $this->colors(), |
@@ -42,7 +42,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -74,14 +74,14 @@ |
||
74 | 74 | |
75 | 75 | return $query_individuals->unionAll($query_families) |
76 | 76 | ->get()->pluck('g_gedcom') |
77 | - ->flatMap(static function (string $gedcom): array { |
|
77 | + ->flatMap(static function(string $gedcom): array { |
|
78 | 78 | preg_match_all('/\n2 PLAC (.+)/', $gedcom, $matches); |
79 | 79 | return $matches[1] ?? []; |
80 | 80 | }) |
81 | 81 | ->sort(I18N::comparator())->reverse() |
82 | - ->mapWithKeys(static function (string $place): array { |
|
82 | + ->mapWithKeys(static function(string $place): array { |
|
83 | 83 | $place_array = array_reverse(array_filter(array_map('trim', explode(",", $place)))); |
84 | - return [ count($place_array) => $place_array ]; |
|
84 | + return [count($place_array) => $place_array]; |
|
85 | 85 | }) |
86 | 86 | ->sortKeys() |
87 | 87 | ->last(); |
@@ -132,7 +132,7 @@ discard block |
||
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 |
||
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)) |
@@ -50,7 +50,7 @@ |
||
50 | 50 | return $this->module_service |
51 | 51 | ->findByInterface(ModuleGeoAnalysisProviderInterface::class, $include_disabled) |
52 | 52 | ->flatMap(fn(ModuleGeoAnalysisProviderInterface $module) => $module->listGeoAnalyses()) |
53 | - ->map(static function (string $analysis_class): ?GeoAnalysisInterface { |
|
53 | + ->map(static function(string $analysis_class): ?GeoAnalysisInterface { |
|
54 | 54 | try { |
55 | 55 | $analysis = app($analysis_class); |
56 | 56 | return $analysis instanceof GeoAnalysisInterface ? $analysis : null; |