@@ -34,7 +34,7 @@ |
||
| 34 | 34 | // Clean up previous sosa table if it exists |
| 35 | 35 | DB::schema()->dropIfExists('maj_sosa'); |
| 36 | 36 | |
| 37 | - DB::schema()->create('maj_sosa', static function (Blueprint $table): void { |
|
| 37 | + DB::schema()->create('maj_sosa', static function(Blueprint $table): void { |
|
| 38 | 38 | |
| 39 | 39 | $table->integer('majs_gedcom_id'); |
| 40 | 40 | $table->integer('majs_user_id')->default(-1); |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | $this->tmp_sosa_table = array(); |
| 75 | 75 | $max_gen_setting = $tree->getUserPreference($user, 'MAJ_SOSA_MAX_GEN'); |
| 76 | 76 | $this->max_generations = is_numeric($max_gen_setting) ? |
| 77 | - (int) $max_gen_setting : |
|
| 78 | - $this->sosa_records_service->maxSystemGenerations(); |
|
| 77 | + (int)$max_gen_setting : $this->sosa_records_service->maxSystemGenerations(); |
|
| 79 | 78 | } |
| 80 | 79 | |
| 81 | 80 | /** |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | if ($ancestor === null || !$ancestor->canShow()) { |
| 79 | 79 | continue; |
| 80 | 80 | } |
| 81 | - $generation = $this->records_service->generation((int) $item->majs_sosa); |
|
| 81 | + $generation = $this->records_service->generation((int)$item->majs_sosa); |
|
| 82 | 82 | $significantplace = new GeoAnalysisPlace($tree, null, $depth); |
| 83 | 83 | foreach ($this->significantPlaces($ancestor) as $place) { |
| 84 | 84 | $significantplace = new GeoAnalysisPlace($tree, $place, $depth, true); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | // How to update the database schema for this module |
| 77 | 77 | private const SCHEMA_TARGET_VERSION = 3; |
| 78 | 78 | private const SCHEMA_SETTING_NAME = 'MAJ_GEODISP_SCHEMA_VERSION'; |
| 79 | - private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema'; |
|
| 79 | + private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__.'\Schema'; |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * {@inheritDoc} |
@@ -126,13 +126,13 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function loadRoutes(Map $router): void |
| 128 | 128 | { |
| 129 | - $router->attach('', '', static function (Map $router): void { |
|
| 129 | + $router->attach('', '', static function(Map $router): void { |
|
| 130 | 130 | |
| 131 | - $router->attach('', '/module-maj/geodispersion', static function (Map $router): void { |
|
| 132 | - $router->attach('', '/admin', static function (Map $router): void { |
|
| 131 | + $router->attach('', '/module-maj/geodispersion', static function(Map $router): void { |
|
| 132 | + $router->attach('', '/admin', static function(Map $router): void { |
|
| 133 | 133 | $router->get(AdminConfigPage::class, '/config{/tree}', AdminConfigPage::class); |
| 134 | 134 | |
| 135 | - $router->attach('', '/analysis-views/{tree}', static function (Map $router): void { |
|
| 135 | + $router->attach('', '/analysis-views/{tree}', static function(Map $router): void { |
|
| 136 | 136 | $router->tokens(['view_id' => '\d+', 'enable' => '[01]']); |
| 137 | 137 | $router->extras([ |
| 138 | 138 | 'middleware' => [ |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | //phpcs:enable |
| 152 | 152 | }); |
| 153 | 153 | |
| 154 | - $router->attach('', '/map-adapters/{tree}', static function (Map $router): void { |
|
| 154 | + $router->attach('', '/map-adapters/{tree}', static function(Map $router): void { |
|
| 155 | 155 | $router->tokens(['adapter_id' => '\d+', 'view_id' => '\d+']); |
| 156 | 156 | $router->extras([ |
| 157 | 157 | 'middleware' => [ |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $router->get(GeoAnalysisViewsList::class, '/list/{tree}', GeoAnalysisViewsList::class); |
| 178 | 178 | |
| 179 | - $router->attach('', '/analysisview/{tree}/{view_id}', static function (Map $router): void { |
|
| 179 | + $router->attach('', '/analysisview/{tree}/{view_id}', static function(Map $router): void { |
|
| 180 | 180 | $router->tokens(['view_id' => '\d+']); |
| 181 | 181 | $router->get(GeoAnalysisViewPage::class, '', GeoAnalysisViewPage::class); |
| 182 | 182 | $router->get(GeoAnalysisViewTabs::class, '/tabs', GeoAnalysisViewTabs::class); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public function headContent(): string |
| 216 | 216 | { |
| 217 | - return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
| 217 | + return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">'; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | ->all($tree) |
| 68 | 68 | ->sortBy(fn(AbstractGeoAnalysisView $view) => $view->description()); |
| 69 | 69 | |
| 70 | - return $this->viewResponse($this->module->name() . '::geoanalysisviews-list', [ |
|
| 70 | + return $this->viewResponse($this->module->name().'::geoanalysisviews-list', [ |
|
| 71 | 71 | 'module' => $this->module, |
| 72 | 72 | 'title' => I18N::translate('Geographical dispersion'), |
| 73 | 73 | 'tree' => $tree, |
@@ -87,7 +87,7 @@ |
||
| 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, |
@@ -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 | /** |
@@ -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 | /** |
@@ -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 | } |