Passed
Branch feature/2.1-geodispersion-dev (38d49e)
by Jonathan
04:17
created
Webtrees/Module/GeoDispersion/Http/RequestHandlers/GeoAnalysisViewsList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
Webtrees/Module/GeoDispersion/Http/RequestHandlers/GeoAnalysisViewPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@
 block discarded – undo
63 63
         assert($tree instanceof Tree);
64 64
 
65 65
         $view_id = $request->getAttribute('view_id');
66
-        $view_id = is_numeric($view_id) ? (int) $view_id : 0;
66
+        $view_id = is_numeric($view_id) ? (int)$view_id : 0;
67 67
 
68
-        return $this->viewResponse($this->module->name() . '::geoanalysisview-page', [
68
+        return $this->viewResponse($this->module->name().'::geoanalysisview-page', [
69 69
             'module_name'           =>  $this->module->name(),
70 70
             'title'                 =>  I18N::translate('Geographical dispersion'),
71 71
             'tree'                  =>  $tree,
Please login to merge, or discard this patch.
src/Webtrees/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.
src/Webtrees/Module/GeoDispersion/Schema/Migration1.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Services/MapDefinitionsService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Services/PlacesReferenceTableService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/AbstractGeoAnalysisView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Http/RequestHandlers/TasksList.php 1 patch
Spacing   +10 added lines, -11 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Http/RequestHandlers/TaskEditAction.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             return redirect($admin_config_route);
73 73
         }
74 74
 
75
-        $task_sched_id = (int) $request->getAttribute('task');
75
+        $task_sched_id = (int)$request->getAttribute('task');
76 76
         $task_schedule = $this->taskschedules_service->find($task_sched_id);
77 77
 
78 78
         if ($task_schedule === null) {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 'success'
93 93
             );
94 94
             //phpcs:ignore Generic.Files.LineLength.TooLong
95
-            Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.');
95
+            Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” has been updated.');
96 96
         }
97 97
 
98 98
         return redirect($admin_config_route);
@@ -111,17 +111,17 @@  discard block
 block discarded – undo
111 111
             return false;
112 112
         }
113 113
 
114
-        $params = (array) $request->getParsedBody();
114
+        $params = (array)$request->getParsedBody();
115 115
 
116
-        $frequency = (int) $params['frequency'];
116
+        $frequency = (int)$params['frequency'];
117 117
         if ($frequency > 0) {
118 118
             $task_schedule->setFrequency(CarbonInterval::minutes($frequency));
119 119
         } else {
120 120
             FlashMessages::addMessage(I18N::translate('The frequency is not in a valid format'), 'danger');
121 121
         }
122 122
 
123
-        $is_limited = (bool) $params['is_limited'];
124
-        $nb_occur = (int) $params['nb_occur'];
123
+        $is_limited = (bool)$params['is_limited'];
124
+        $nb_occur = (int)$params['nb_occur'];
125 125
 
126 126
         if ($is_limited) {
127 127
             if ($nb_occur > 0) {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
         FlashMessages::addMessage(I18N::translate('An error occured while updating the scheduled task'), 'danger');
153 153
         //@phpcs:ignore Generic.Files.LineLength.TooLong
154
-        Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.');
154
+        Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” could not be updated. See error log.');
155 155
         return false;
156 156
     }
157 157
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                 'danger'
184 184
             );
185 185
             //phpcs:ignore Generic.Files.LineLength.TooLong
186
-            Log::addConfigurationLog('Module ' . $this->module->title() . ' : AdminTask “' . $task->name() . '” specific settings could not be updated. See error log.');
186
+            Log::addConfigurationLog('Module '.$this->module->title().' : AdminTask “'.$task->name().'” specific settings could not be updated. See error log.');
187 187
         }
188 188
 
189 189
         return true;
Please login to merge, or discard this patch.