@@ -111,7 +111,7 @@ |
||
| 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 | /** |
@@ -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(), |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function upgrade(): void |
| 32 | 32 | { |
| 33 | - DB::schema()->create('maj_geodisp_views', static function (Blueprint $table): void { |
|
| 33 | + DB::schema()->create('maj_geodisp_views', static function(Blueprint $table): void { |
|
| 34 | 34 | $table->integer('majgv_id')->autoIncrement(); |
| 35 | 35 | $table->integer('majgv_gedcom_id')->index(); |
| 36 | 36 | $table->string('majgv_view_class', 255); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $table->foreign('majgv_gedcom_id')->references('gedcom_id')->on('gedcom')->onDelete('cascade'); |
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | - DB::schema()->create('maj_geodisp_mapviews', static function (Blueprint $table): void { |
|
| 47 | + DB::schema()->create('maj_geodisp_mapviews', static function(Blueprint $table): void { |
|
| 48 | 48 | $table->integer('majgm_id')->autoIncrement(); |
| 49 | 49 | $table->integer('majgm_majgv_id')->index(); |
| 50 | 50 | $table->string('majgm_map_id', 127); |
@@ -91,7 +91,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | fn() => $this->module_service |
| 65 | 65 | ->findByInterface(ModuleMapDefinitionProviderInterface::class, $include_disabled) |
| 66 | 66 | ->flatMap(fn(ModuleMapDefinitionProviderInterface $module) => $module->listMapDefinition()) |
| 67 | - ->mapWithKeys(fn(MapDefinitionInterface $map) => [ $map->id() => $map ]) |
|
| 67 | + ->mapWithKeys(fn(MapDefinitionInterface $map) => [$map->id() => $map]) |
|
| 68 | 68 | ); |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -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 | } |
@@ -49,14 +49,14 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | ); |
@@ -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(); |