@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ->filter( |
| 48 | 48 | /** @psalm-suppress MissingClosureParamType */ |
| 49 | 49 | fn($item): bool => $item instanceof Place |
| 50 | - )->map(fn(Place $place): array => [ $place->tree()->id(), $place->gedcomName() ]) |
|
| 50 | + )->map(fn(Place $place): array => [$place->tree()->id(), $place->gedcomName()]) |
|
| 51 | 51 | ->toArray() |
| 52 | 52 | ]; |
| 53 | 53 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ->filter( |
| 68 | 68 | /** @psalm-suppress MissingClosureParamType */ |
| 69 | 69 | fn($item): bool => is_array($item) && count($item) == 2 |
| 70 | - )->map(function (array $item): ?Place { |
|
| 70 | + )->map(function(array $item): ?Place { |
|
| 71 | 71 | try { |
| 72 | 72 | return new Place($item[1], $this->tree_service->find($item[0])); |
| 73 | 73 | } catch (RuntimeException $ex) { |
@@ -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); |
@@ -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 | } |
@@ -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 | ); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function find(Tree $tree, int $id): ?AbstractGeoAnalysisView |
| 59 | 59 | { |
| 60 | - return $this->all($tree)->first(fn(AbstractGeoAnalysisView $view): bool => $view->id() === $id); |
|
| 60 | + return $this->all($tree)->first(fn(AbstractGeoAnalysisView $view) : bool => $view->id() === $id); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | return Registry::cache()->array()->remember( |
| 75 | 75 | 'all-geodispersion-views', |
| 76 | - function () use ($tree, $include_disabled): Collection { |
|
| 76 | + function() use ($tree, $include_disabled): Collection { |
|
| 77 | 77 | return DB::table('maj_geodisp_views') |
| 78 | 78 | ->select('maj_geodisp_views.*') |
| 79 | 79 | ->where('majgv_gedcom_id', '=', $tree->id()) |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | private function viewMapper(Tree $tree): Closure |
| 113 | 113 | { |
| 114 | - return function (stdClass $row) use ($tree): ?AbstractGeoAnalysisView { |
|
| 114 | + return function(stdClass $row) use ($tree): ?AbstractGeoAnalysisView { |
|
| 115 | 115 | try { |
| 116 | 116 | $geoanalysis = app($row->majgv_analysis); |
| 117 | 117 | if (!($geoanalysis instanceof GeoAnalysisInterface)) { |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $view = app()->makeWith($row->majgv_view_class, [ |
| 122 | - 'id' => (int) $row->majgv_id, |
|
| 122 | + 'id' => (int)$row->majgv_id, |
|
| 123 | 123 | 'tree' => $tree, |
| 124 | 124 | 'enabled' => $row->majgv_status === 'enabled', |
| 125 | 125 | 'description' => $row->majgv_descr, |
| 126 | 126 | 'geoanalysis' => $geoanalysis, |
| 127 | - 'depth' => (int) $row->majgv_place_depth, |
|
| 128 | - 'detailed_top_places' => (int) $row->majgv_top_places |
|
| 127 | + 'depth' => (int)$row->majgv_place_depth, |
|
| 128 | + 'detailed_top_places' => (int)$row->majgv_top_places |
|
| 129 | 129 | ]); |
| 130 | 130 | |
| 131 | 131 | if ($row->majgv_colors !== null && $view instanceof GeoAnalysisMap) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | private function mapAdapterMapper(): Closure |
| 150 | 150 | { |
| 151 | - return function (stdClass $row): ?GeoAnalysisMapAdapter { |
|
| 151 | + return function(stdClass $row): ?GeoAnalysisMapAdapter { |
|
| 152 | 152 | if (null === $map = $this->mapdefinition_service->find($row->majgm_map_id)) { |
| 153 | 153 | return null; |
| 154 | 154 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | return new GeoAnalysisMapAdapter( |
| 162 | - (int) $row->majgm_id, |
|
| 162 | + (int)$row->majgm_id, |
|
| 163 | 163 | $map, |
| 164 | 164 | app($row->majgm_mapper), |
| 165 | 165 | new MapViewConfig($row->majgm_feature_prop, $this->mapperConfigDecoder($row->majgm_config)) |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | private function enabledFilter(bool $include_disabled): Closure |
| 233 | 233 | { |
| 234 | - return function (AbstractGeoAnalysisView $view) use ($include_disabled): bool { |
|
| 234 | + return function(AbstractGeoAnalysisView $view) use ($include_disabled): bool { |
|
| 235 | 235 | return $include_disabled || $view->isEnabled(); |
| 236 | 236 | }; |
| 237 | 237 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function icon(ModuleInterface $module): string |
| 28 | 28 | { |
| 29 | - return view($module->name() . '::icons/view-table'); |
|
| 29 | + return view($module->name().'::icons/view-table'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | GeoAnalysisViewDataService $geoview_data_service, |
| 40 | 40 | array $params |
| 41 | 41 | ): string { |
| 42 | - return view($module->name() . '::geoanalysisview-tab-glb-table', $params + [ |
|
| 42 | + return view($module->name().'::geoanalysisview-tab-glb-table', $params + [ |
|
| 43 | 43 | 'result' => $result |
| 44 | 44 | ]); |
| 45 | 45 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function icon(ModuleInterface $module): string |
| 36 | 36 | { |
| 37 | - return view($module->name() . '::icons/view-map'); |
|
| 37 | + return view($module->name().'::icons/view-map'); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -53,12 +53,11 @@ discard block |
||
| 53 | 53 | foreach ($map_adapters as $map_adapter) { |
| 54 | 54 | $adapter_result_tmp = $map_adapter->convert($result); |
| 55 | 55 | $adapter_result = $adapter_result === null ? |
| 56 | - $adapter_result_tmp : |
|
| 57 | - $adapter_result->merge($adapter_result_tmp); |
|
| 56 | + $adapter_result_tmp : $adapter_result->merge($adapter_result_tmp); |
|
| 58 | 57 | } |
| 59 | 58 | |
| 60 | 59 | if ($adapter_result === null) { |
| 61 | - return view($module->name() . '::errors/tab-error', [ |
|
| 60 | + return view($module->name().'::errors/tab-error', [ |
|
| 62 | 61 | 'message' => I18N::translate('The map could not be loaded.'), |
| 63 | 62 | ]); |
| 64 | 63 | } |
@@ -73,7 +72,7 @@ discard block |
||
| 73 | 72 | ]; |
| 74 | 73 | //phpcs:enable |
| 75 | 74 | |
| 76 | - return view($module->name() . '::geoanalysisview-tab-glb-map', $params + [ |
|
| 75 | + return view($module->name().'::geoanalysisview-tab-glb-map', $params + [ |
|
| 77 | 76 | 'result' => $adapter_result->geoAnalysisResult(), |
| 78 | 77 | 'features' => $adapter_result->features(), |
| 79 | 78 | 'colors' => $this->colors(), |
@@ -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 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $task_schedules = $this->taskschedules_service->all(true, true) |
| 77 | - ->map(function (TaskSchedule $value): array { |
|
| 77 | + ->map(function(TaskSchedule $value): array { |
|
| 78 | 78 | |
| 79 | 79 | $row = $value->toArray(); |
| 80 | 80 | $task = $this->taskschedules_service->findTask($row['task_id']); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $search_columns = ['task_name']; |
| 86 | 86 | $sort_columns = ['task_name', 'enabled', 'last_run']; |
| 87 | 87 | |
| 88 | - $callback = function (array $row): array { |
|
| 88 | + $callback = function(array $row): array { |
|
| 89 | 89 | if ($this->module === null) { |
| 90 | 90 | return []; |
| 91 | 91 | } |
@@ -112,21 +112,20 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $module_name = $this->module->name(); |
| 114 | 114 | $datum = [ |
| 115 | - view($module_name . '::admin/tasks-table-options', $task_options_params), |
|
| 116 | - view($module_name . '::components/yes-no-icons', ['yes' => $row['enabled']]), |
|
| 117 | - '<span dir="auto">' . e($row['task_name']) . '</span>', |
|
| 115 | + view($module_name.'::admin/tasks-table-options', $task_options_params), |
|
| 116 | + view($module_name.'::components/yes-no-icons', ['yes' => $row['enabled']]), |
|
| 117 | + '<span dir="auto">'.e($row['task_name']).'</span>', |
|
| 118 | 118 | $row['last_run']->unix() === 0 ? |
| 119 | - view('components/datetime', ['timestamp' => $row['last_run']]) : |
|
| 120 | - view('components/datetime-diff', ['timestamp' => $row['last_run']]), |
|
| 121 | - view($module_name . '::components/yes-no-icons', ['yes' => $row['last_result']]), |
|
| 122 | - '<span dir="auto">' . e($row['frequency']->cascade()->forHumans()) . '</span>', |
|
| 119 | + view('components/datetime', ['timestamp' => $row['last_run']]) : view('components/datetime-diff', ['timestamp' => $row['last_run']]), |
|
| 120 | + view($module_name.'::components/yes-no-icons', ['yes' => $row['last_result']]), |
|
| 121 | + '<span dir="auto">'.e($row['frequency']->cascade()->forHumans()).'</span>', |
|
| 123 | 122 | $row['nb_occurrences'] > 0 ? I18N::number($row['nb_occurrences']) : I18N::translate('Unlimited'), |
| 124 | - view($module_name . '::components/yes-no-icons', [ |
|
| 123 | + view($module_name.'::components/yes-no-icons', [ |
|
| 125 | 124 | 'yes' => $row['is_running'], |
| 126 | 125 | 'text_yes' => I18N::translate('Running'), |
| 127 | 126 | 'text_no' => I18N::translate('Not running') |
| 128 | 127 | ]), |
| 129 | - view($module_name . '::admin/tasks-table-run', $task_run_params) |
|
| 128 | + view($module_name.'::admin/tasks-table-run', $task_run_params) |
|
| 130 | 129 | ]; |
| 131 | 130 | |
| 132 | 131 | return $datum; |