Passed
Push — main ( 9fcb9f...c808ff )
by Jonathan
04:18
created
app/Module/GeoDispersion/Schema/Migration0.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@
 block discarded – undo
21 21
  */
22 22
 class Migration0 implements MigrationInterface
23 23
 {
24
-    /**
25
-     * {@inheritDoc}
26
-     * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade()
27
-     */
28
-    public function upgrade(): void
29
-    {
30
-        // This migration has been superseded by migration 1.
31
-    }
24
+	/**
25
+	 * {@inheritDoc}
26
+	 * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade()
27
+	 */
28
+	public function upgrade(): void
29
+	{
30
+		// This migration has been superseded by migration 1.
31
+	}
32 32
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Schema/Migration2.php 1 patch
Indentation   +193 added lines, -193 removed lines patch added patch discarded remove patch
@@ -39,219 +39,219 @@
 block discarded – undo
39 39
  */
40 40
 class Migration2 implements MigrationInterface
41 41
 {
42
-    /**
43
-     * Mapping from old map definitions to new ones
44
-     * @var array<string,mixed> MAPS_XML_MAPPING
45
-     */
46
-    private const MAPS_XML_MAPPING = [
47
-        'aubracmargeridebycommunes.xml' =>  'fr-area-aubrac-lot-margeride-planeze-communes',
48
-        'calvadosbycommunes.xml'        =>  'fr-dpt-14-communes',
49
-        'cantalbycommunes.xml'          =>  'fr-dpt-15-communes',
50
-        'cotesdarmorbycommunes.xml'     =>  'fr-dpt-22-communes',
51
-        'essonnebycommunes.xml'         =>  'fr-dpt-91-communes',
52
-        'eurebycommunes.xml'            =>  'fr-dpt-27-communes',
53
-        'eureetloirbycommunes.xml'      =>  'fr-dpt-28-communes',
54
-        'francebydepartements.xml'      =>  'fr-metropole-departements',
55
-        'francebyregions1970.xml'       =>  'fr-metropole-regions-1970',
56
-        'francebyregions2016.xml'       =>  'fr-metropole-regions-2016',
57
-        'hauteloirebycommunes.xml'      =>  'fr-dpt-43-communes',
58
-        'illeetvilainebycommunes.xml'   =>  'fr-dpt-35-communes',
59
-        'loiretbycommunes.xml'          =>  'fr-dpt-45-communes',
60
-        'lozerebycodepostaux.xml'       =>  'fr-dpt-48-codespostaux',
61
-        'lozerebycommunes.xml'          =>  'fr-dpt-48-communes',
62
-        'mayennebycommunes.xml'         =>  'fr-dpt-53-communes',
63
-        'oisebycommunes.xml'            =>  'fr-dpt-60-communes',
64
-        'ornebycommunes.xml'            =>  'fr-dpt-61-communes',
65
-        'puydedomebycommunes.xml'       =>  'fr-dpt-63-communes',
66
-        'sarthebycommunes.xml'          =>  'fr-dpt-72-communes',
67
-        'seinemaritimebycommunes.xml'   =>  'fr-dpt-76-communes',
68
-        'seinesommeoisebycommunes.xml'  =>  ['fr-dpt-60-communes', 'fr-dpt-76-communes', 'fr-dpt-80-communes'],
69
-        'valdoisebycommunes.xml'        =>  'fr-dpt-95-communes',
70
-        'yvelinesbycommunes.xml'        =>  'fr-dpt-78-communes'
71
-    ];
42
+	/**
43
+	 * Mapping from old map definitions to new ones
44
+	 * @var array<string,mixed> MAPS_XML_MAPPING
45
+	 */
46
+	private const MAPS_XML_MAPPING = [
47
+		'aubracmargeridebycommunes.xml' =>  'fr-area-aubrac-lot-margeride-planeze-communes',
48
+		'calvadosbycommunes.xml'        =>  'fr-dpt-14-communes',
49
+		'cantalbycommunes.xml'          =>  'fr-dpt-15-communes',
50
+		'cotesdarmorbycommunes.xml'     =>  'fr-dpt-22-communes',
51
+		'essonnebycommunes.xml'         =>  'fr-dpt-91-communes',
52
+		'eurebycommunes.xml'            =>  'fr-dpt-27-communes',
53
+		'eureetloirbycommunes.xml'      =>  'fr-dpt-28-communes',
54
+		'francebydepartements.xml'      =>  'fr-metropole-departements',
55
+		'francebyregions1970.xml'       =>  'fr-metropole-regions-1970',
56
+		'francebyregions2016.xml'       =>  'fr-metropole-regions-2016',
57
+		'hauteloirebycommunes.xml'      =>  'fr-dpt-43-communes',
58
+		'illeetvilainebycommunes.xml'   =>  'fr-dpt-35-communes',
59
+		'loiretbycommunes.xml'          =>  'fr-dpt-45-communes',
60
+		'lozerebycodepostaux.xml'       =>  'fr-dpt-48-codespostaux',
61
+		'lozerebycommunes.xml'          =>  'fr-dpt-48-communes',
62
+		'mayennebycommunes.xml'         =>  'fr-dpt-53-communes',
63
+		'oisebycommunes.xml'            =>  'fr-dpt-60-communes',
64
+		'ornebycommunes.xml'            =>  'fr-dpt-61-communes',
65
+		'puydedomebycommunes.xml'       =>  'fr-dpt-63-communes',
66
+		'sarthebycommunes.xml'          =>  'fr-dpt-72-communes',
67
+		'seinemaritimebycommunes.xml'   =>  'fr-dpt-76-communes',
68
+		'seinesommeoisebycommunes.xml'  =>  ['fr-dpt-60-communes', 'fr-dpt-76-communes', 'fr-dpt-80-communes'],
69
+		'valdoisebycommunes.xml'        =>  'fr-dpt-95-communes',
70
+		'yvelinesbycommunes.xml'        =>  'fr-dpt-78-communes'
71
+	];
72 72
 
73
-    /**
74
-     * {@inheritDoc}
75
-     * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade()
76
-     */
77
-    public function upgrade(): void
78
-    {
79
-        if (!DB::schema()->hasTable('maj_geodispersion')) {
80
-            return;
81
-        }
73
+	/**
74
+	 * {@inheritDoc}
75
+	 * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade()
76
+	 */
77
+	public function upgrade(): void
78
+	{
79
+		if (!DB::schema()->hasTable('maj_geodispersion')) {
80
+			return;
81
+		}
82 82
 
83
-        /** @var TreeService $tree_service */
84
-        $tree_service = app(TreeService::class);
85
-        /** @var GeoAnalysisViewDataService $geoview_data_service */
86
-        $geoview_data_service = app(GeoAnalysisViewDataService::class);
83
+		/** @var TreeService $tree_service */
84
+		$tree_service = app(TreeService::class);
85
+		/** @var GeoAnalysisViewDataService $geoview_data_service */
86
+		$geoview_data_service = app(GeoAnalysisViewDataService::class);
87 87
 
88
-        $existing_views = DB::table('maj_geodispersion')
89
-            ->select()
90
-            ->get();
88
+		$existing_views = DB::table('maj_geodispersion')
89
+			->select()
90
+			->get();
91 91
 
92
-        foreach ($existing_views as $old_view) {
93
-            try {
94
-                $tree = $tree_service->find((int) $old_view->majgd_file);
95
-            } catch (RuntimeException $ex) {
96
-                continue;
97
-            }
92
+		foreach ($existing_views as $old_view) {
93
+			try {
94
+				$tree = $tree_service->find((int) $old_view->majgd_file);
95
+			} catch (RuntimeException $ex) {
96
+				continue;
97
+			}
98 98
 
99
-            if ($old_view->majgd_map === null) {
100
-                $this->migrateGeoAnalysisTable($old_view, $tree, $geoview_data_service);
101
-            } else {
102
-                DB::connection()->beginTransaction();
103
-                if ($this->migrateGeoAnalysisMap($old_view, $tree, $geoview_data_service)) {
104
-                    DB::connection()->commit();
105
-                } else {
106
-                    DB::connection()->rollBack();
107
-                }
108
-            }
109
-        }
99
+			if ($old_view->majgd_map === null) {
100
+				$this->migrateGeoAnalysisTable($old_view, $tree, $geoview_data_service);
101
+			} else {
102
+				DB::connection()->beginTransaction();
103
+				if ($this->migrateGeoAnalysisMap($old_view, $tree, $geoview_data_service)) {
104
+					DB::connection()->commit();
105
+				} else {
106
+					DB::connection()->rollBack();
107
+				}
108
+			}
109
+		}
110 110
 
111
-        $in_transaction = DB::connection()->getPdo()->inTransaction();
111
+		$in_transaction = DB::connection()->getPdo()->inTransaction();
112 112
 
113
-        DB::schema()->drop('maj_geodispersion');
113
+		DB::schema()->drop('maj_geodispersion');
114 114
 
115
-        if ($in_transaction && !DB::connection()->getPdo()->inTransaction()) {
116
-            DB::connection()->beginTransaction();
117
-        }
115
+		if ($in_transaction && !DB::connection()->getPdo()->inTransaction()) {
116
+			DB::connection()->beginTransaction();
117
+		}
118 118
 
119
-        FlashMessages::addMessage(I18N::translate(
120
-            'The geographical dispersion analyses have been migrated for webtrees 2. Please review their settings.'
121
-        ));
122
-    }
119
+		FlashMessages::addMessage(I18N::translate(
120
+			'The geographical dispersion analyses have been migrated for webtrees 2. Please review their settings.'
121
+		));
122
+	}
123 123
 
124
-    /**
125
-     * Create a Table geographical analysis view from a migrated item.
126
-     *
127
-     * @param stdClass $old_view
128
-     * @param Tree $tree
129
-     * @param GeoAnalysisViewDataService $geoview_data_service
130
-     * @return bool
131
-     */
132
-    private function migrateGeoAnalysisTable(
133
-        stdClass $old_view,
134
-        Tree $tree,
135
-        GeoAnalysisViewDataService $geoview_data_service
136
-    ): bool {
137
-        $new_view = new GeoAnalysisTable(
138
-            0,
139
-            $tree,
140
-            $old_view->majgd_status === 'enabled',
141
-            $old_view->majgd_descr,
142
-            app(SosaByGenerationGeoAnalysis::class),
143
-            (int) $old_view->majgd_sublevel,
144
-            (int) $old_view->majgd_detailsgen
145
-        );
124
+	/**
125
+	 * Create a Table geographical analysis view from a migrated item.
126
+	 *
127
+	 * @param stdClass $old_view
128
+	 * @param Tree $tree
129
+	 * @param GeoAnalysisViewDataService $geoview_data_service
130
+	 * @return bool
131
+	 */
132
+	private function migrateGeoAnalysisTable(
133
+		stdClass $old_view,
134
+		Tree $tree,
135
+		GeoAnalysisViewDataService $geoview_data_service
136
+	): bool {
137
+		$new_view = new GeoAnalysisTable(
138
+			0,
139
+			$tree,
140
+			$old_view->majgd_status === 'enabled',
141
+			$old_view->majgd_descr,
142
+			app(SosaByGenerationGeoAnalysis::class),
143
+			(int) $old_view->majgd_sublevel,
144
+			(int) $old_view->majgd_detailsgen
145
+		);
146 146
 
147
-        return $geoview_data_service->insertGetId($new_view) > 0;
148
-    }
147
+		return $geoview_data_service->insertGetId($new_view) > 0;
148
+	}
149 149
 
150
-    /**
151
-     * Create a Map geographical analysis view from a migrated item.
152
-     *
153
-     * @param stdClass $old_view
154
-     * @param Tree $tree
155
-     * @param GeoAnalysisViewDataService $geoview_data_service
156
-     * @return bool
157
-     */
158
-    private function migrateGeoAnalysisMap(
159
-        stdClass $old_view,
160
-        Tree $tree,
161
-        GeoAnalysisViewDataService $geoview_data_service
162
-    ): bool {
163
-        /** @var MapDefinitionsService $map_definition_service */
164
-        $map_definition_service = app(MapDefinitionsService::class);
165
-        /** @var MapAdapterDataService $mapadapter_data_service */
166
-        $mapadapter_data_service = app(MapAdapterDataService::class);
150
+	/**
151
+	 * Create a Map geographical analysis view from a migrated item.
152
+	 *
153
+	 * @param stdClass $old_view
154
+	 * @param Tree $tree
155
+	 * @param GeoAnalysisViewDataService $geoview_data_service
156
+	 * @return bool
157
+	 */
158
+	private function migrateGeoAnalysisMap(
159
+		stdClass $old_view,
160
+		Tree $tree,
161
+		GeoAnalysisViewDataService $geoview_data_service
162
+	): bool {
163
+		/** @var MapDefinitionsService $map_definition_service */
164
+		$map_definition_service = app(MapDefinitionsService::class);
165
+		/** @var MapAdapterDataService $mapadapter_data_service */
166
+		$mapadapter_data_service = app(MapAdapterDataService::class);
167 167
 
168
-        $new_view = new GeoAnalysisMap(
169
-            0,
170
-            $tree,
171
-            $old_view->majgd_status === 'enabled',
172
-            $old_view->majgd_descr,
173
-            app(SosaByGenerationGeoAnalysis::class),
174
-            (int) $old_view->majgd_sublevel,
175
-            (int) $old_view->majgd_detailsgen
176
-        );
168
+		$new_view = new GeoAnalysisMap(
169
+			0,
170
+			$tree,
171
+			$old_view->majgd_status === 'enabled',
172
+			$old_view->majgd_descr,
173
+			app(SosaByGenerationGeoAnalysis::class),
174
+			(int) $old_view->majgd_sublevel,
175
+			(int) $old_view->majgd_detailsgen
176
+		);
177 177
 
178
-        $view_id = $geoview_data_service->insertGetId($new_view);
179
-        if ($view_id === 0) {
180
-            return false;
181
-        }
182
-        $new_view = $new_view->withId($view_id);
178
+		$view_id = $geoview_data_service->insertGetId($new_view);
179
+		if ($view_id === 0) {
180
+			return false;
181
+		}
182
+		$new_view = $new_view->withId($view_id);
183 183
 
184
-        $colors = $new_view->colors();
185
-        foreach ($this->mapIdsFromOld($old_view->majgd_map) as $new_map_id) {
186
-            $map = $map_definition_service->find($new_map_id);
187
-            if ($map === null) {
188
-                return false;
189
-            }
190
-            $colors = $this->colorsFromMap($new_map_id);
184
+		$colors = $new_view->colors();
185
+		foreach ($this->mapIdsFromOld($old_view->majgd_map) as $new_map_id) {
186
+			$map = $map_definition_service->find($new_map_id);
187
+			if ($map === null) {
188
+				return false;
189
+			}
190
+			$colors = $this->colorsFromMap($new_map_id);
191 191
 
192
-            /** @var SimplePlaceMapper $mapper */
193
-            $mapper = app(SimplePlaceMapper::class);
194
-            $mapview_config = new MapViewConfig($this->mappingPropertyForMap($new_map_id), $mapper->config());
195
-            $map_adapter = new GeoAnalysisMapAdapter(0, $view_id, $map, $mapper, $mapview_config);
192
+			/** @var SimplePlaceMapper $mapper */
193
+			$mapper = app(SimplePlaceMapper::class);
194
+			$mapview_config = new MapViewConfig($this->mappingPropertyForMap($new_map_id), $mapper->config());
195
+			$map_adapter = new GeoAnalysisMapAdapter(0, $view_id, $map, $mapper, $mapview_config);
196 196
 
197
-            $mapadapter_data_service->insertGetId($map_adapter);
198
-        }
197
+			$mapadapter_data_service->insertGetId($map_adapter);
198
+		}
199 199
 
200
-        return $geoview_data_service->update($new_view->withColors($colors)) > 0;
201
-    }
200
+		return $geoview_data_service->update($new_view->withColors($colors)) > 0;
201
+	}
202 202
 
203
-    /**
204
-     * Get all new map definitions IDs representing an old map definition
205
-     *
206
-     * @param string $map_xml
207
-     * @return string[]
208
-     */
209
-    private function mapIdsFromOld(string $map_xml): array
210
-    {
211
-        $mapping = self::MAPS_XML_MAPPING[$map_xml] ?? [];
212
-        return is_array($mapping) ? $mapping : [ $mapping ];
213
-    }
203
+	/**
204
+	 * Get all new map definitions IDs representing an old map definition
205
+	 *
206
+	 * @param string $map_xml
207
+	 * @return string[]
208
+	 */
209
+	private function mapIdsFromOld(string $map_xml): array
210
+	{
211
+		$mapping = self::MAPS_XML_MAPPING[$map_xml] ?? [];
212
+		return is_array($mapping) ? $mapping : [ $mapping ];
213
+	}
214 214
 
215
-    /**
216
-     * Get the mapping property to be used for the migrated map adapter
217
-     *
218
-     * @param string $map_id
219
-     * @return string
220
-     */
221
-    private function mappingPropertyForMap(string $map_id): string
222
-    {
223
-        switch ($map_id) {
224
-            case 'fr-metropole-regions-1970':
225
-            case 'fr-metropole-regions-2016':
226
-                return 'region_insee_libelle';
227
-            case 'fr-metropole-departements':
228
-                return 'dpt_insee_libelle';
229
-            case 'fr-dpt-48-codespostaux':
230
-                return 'code_postal';
231
-            default:
232
-                return 'commune_insee_libelle';
233
-        }
234
-    }
215
+	/**
216
+	 * Get the mapping property to be used for the migrated map adapter
217
+	 *
218
+	 * @param string $map_id
219
+	 * @return string
220
+	 */
221
+	private function mappingPropertyForMap(string $map_id): string
222
+	{
223
+		switch ($map_id) {
224
+			case 'fr-metropole-regions-1970':
225
+			case 'fr-metropole-regions-2016':
226
+				return 'region_insee_libelle';
227
+			case 'fr-metropole-departements':
228
+				return 'dpt_insee_libelle';
229
+			case 'fr-dpt-48-codespostaux':
230
+				return 'code_postal';
231
+			default:
232
+				return 'commune_insee_libelle';
233
+		}
234
+	}
235 235
 
236
-    /**
237
-     * Get the color configuration to be used for the migrated map view
238
-     *
239
-     * @param string $map_id
240
-     * @return MapColorsConfig
241
-     */
242
-    private function colorsFromMap(string $map_id): MapColorsConfig
243
-    {
244
-        $default = Hex::fromString('#f5f5f5');
245
-        $stroke = Hex::fromString('#d5d5d5');
246
-        $hover = Hex::fromString('#ff6600');
236
+	/**
237
+	 * Get the color configuration to be used for the migrated map view
238
+	 *
239
+	 * @param string $map_id
240
+	 * @return MapColorsConfig
241
+	 */
242
+	private function colorsFromMap(string $map_id): MapColorsConfig
243
+	{
244
+		$default = Hex::fromString('#f5f5f5');
245
+		$stroke = Hex::fromString('#d5d5d5');
246
+		$hover = Hex::fromString('#ff6600');
247 247
 
248
-        switch ($map_id) {
249
-            case 'fr-metropole-departements':
250
-                return new MapColorsConfig($default, $stroke, Hex::fromString('#0493ab'), $hover);
251
-            case 'fr-dpt-48-codespostaux':
252
-                return new MapColorsConfig($default, $stroke, Hex::fromString('#44aa00'), $hover);
253
-            default:
254
-                return new MapColorsConfig($default, $stroke, Hex::fromString('#e2a61d'), $hover);
255
-        }
256
-    }
248
+		switch ($map_id) {
249
+			case 'fr-metropole-departements':
250
+				return new MapColorsConfig($default, $stroke, Hex::fromString('#0493ab'), $hover);
251
+			case 'fr-dpt-48-codespostaux':
252
+				return new MapColorsConfig($default, $stroke, Hex::fromString('#44aa00'), $hover);
253
+			default:
254
+				return new MapColorsConfig($default, $stroke, Hex::fromString('#e2a61d'), $hover);
255
+		}
256
+	}
257 257
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Schema/Migration1.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -23,41 +23,41 @@
 block discarded – undo
23 23
  */
24 24
 class Migration1 implements MigrationInterface
25 25
 {
26
-    /**
27
-     * {@inheritDoc}
28
-     * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade()
29
-     */
30
-    public function upgrade(): void
31
-    {
32
-        $in_transaction = DB::connection()->getPdo()->inTransaction();
33
-
34
-        DB::schema()->create('maj_geodisp_views', static function (Blueprint $table): void {
35
-            $table->integer('majgv_id')->autoIncrement();
36
-            $table->integer('majgv_gedcom_id')->index();
37
-            $table->string('majgv_view_class', 255);
38
-            $table->enum('majgv_status', ['enabled', 'disabled'])->default('enabled');
39
-            $table->string('majgv_descr', 248);
40
-            $table->string('majgv_analysis', 255);
41
-            $table->tinyInteger('majgv_place_depth')->default(1);
42
-            $table->tinyInteger('majgv_top_places')->default(0);
43
-            $table->json('majgv_colors')->nullable();
44
-
45
-            $table->foreign('majgv_gedcom_id')->references('gedcom_id')->on('gedcom')->onDelete('cascade');
46
-        });
47
-
48
-        DB::schema()->create('maj_geodisp_mapviews', static function (Blueprint $table): void {
49
-            $table->integer('majgm_id')->autoIncrement();
50
-            $table->integer('majgm_majgv_id')->index();
51
-            $table->string('majgm_map_id', 127);
52
-            $table->string('majgm_mapper', 255);
53
-            $table->string('majgm_feature_prop', 31);
54
-            $table->json('majgm_config')->nullable();
55
-
56
-            $table->foreign('majgm_majgv_id')->references('majgv_id')->on('maj_geodisp_views')->onDelete('cascade');
57
-        });
58
-
59
-        if ($in_transaction && !DB::connection()->getPdo()->inTransaction()) {
60
-            DB::connection()->beginTransaction();
61
-        }
62
-    }
26
+	/**
27
+	 * {@inheritDoc}
28
+	 * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade()
29
+	 */
30
+	public function upgrade(): void
31
+	{
32
+		$in_transaction = DB::connection()->getPdo()->inTransaction();
33
+
34
+		DB::schema()->create('maj_geodisp_views', static function (Blueprint $table): void {
35
+			$table->integer('majgv_id')->autoIncrement();
36
+			$table->integer('majgv_gedcom_id')->index();
37
+			$table->string('majgv_view_class', 255);
38
+			$table->enum('majgv_status', ['enabled', 'disabled'])->default('enabled');
39
+			$table->string('majgv_descr', 248);
40
+			$table->string('majgv_analysis', 255);
41
+			$table->tinyInteger('majgv_place_depth')->default(1);
42
+			$table->tinyInteger('majgv_top_places')->default(0);
43
+			$table->json('majgv_colors')->nullable();
44
+
45
+			$table->foreign('majgv_gedcom_id')->references('gedcom_id')->on('gedcom')->onDelete('cascade');
46
+		});
47
+
48
+		DB::schema()->create('maj_geodisp_mapviews', static function (Blueprint $table): void {
49
+			$table->integer('majgm_id')->autoIncrement();
50
+			$table->integer('majgm_majgv_id')->index();
51
+			$table->string('majgm_map_id', 127);
52
+			$table->string('majgm_mapper', 255);
53
+			$table->string('majgm_feature_prop', 31);
54
+			$table->json('majgm_config')->nullable();
55
+
56
+			$table->foreign('majgm_majgv_id')->references('majgv_id')->on('maj_geodisp_views')->onDelete('cascade');
57
+		});
58
+
59
+		if ($in_transaction && !DB::connection()->getPdo()->inTransaction()) {
60
+			DB::connection()->beginTransaction();
61
+		}
62
+	}
63 63
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Http/RequestHandlers/GeoAnalysisViewAddPage.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -32,48 +32,48 @@
 block discarded – undo
32 32
  */
33 33
 class GeoAnalysisViewAddPage implements RequestHandlerInterface
34 34
 {
35
-    use ViewResponseTrait;
35
+	use ViewResponseTrait;
36 36
 
37
-    private ?GeoDispersionModule $module;
38
-    private GeoAnalysisService $geoanalysis_service;
39
-    private GeoAnalysisDataService $geoanalysis_data_service;
37
+	private ?GeoDispersionModule $module;
38
+	private GeoAnalysisService $geoanalysis_service;
39
+	private GeoAnalysisDataService $geoanalysis_data_service;
40 40
 
41
-    /**
42
-     * Constructor for GeoAnalysisViewAddPage Request Handler
43
-     *
44
-     * @param ModuleService $module_service
45
-     * @param GeoAnalysisService $geoanalysis_service
46
-     * @param GeoAnalysisDataService $geoanalysis_data_service
47
-     */
48
-    public function __construct(
49
-        ModuleService $module_service,
50
-        GeoAnalysisService $geoanalysis_service,
51
-        GeoAnalysisDataService $geoanalysis_data_service
52
-    ) {
53
-        $this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
54
-        $this->geoanalysis_service = $geoanalysis_service;
55
-        $this->geoanalysis_data_service = $geoanalysis_data_service;
56
-    }
41
+	/**
42
+	 * Constructor for GeoAnalysisViewAddPage Request Handler
43
+	 *
44
+	 * @param ModuleService $module_service
45
+	 * @param GeoAnalysisService $geoanalysis_service
46
+	 * @param GeoAnalysisDataService $geoanalysis_data_service
47
+	 */
48
+	public function __construct(
49
+		ModuleService $module_service,
50
+		GeoAnalysisService $geoanalysis_service,
51
+		GeoAnalysisDataService $geoanalysis_data_service
52
+	) {
53
+		$this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
54
+		$this->geoanalysis_service = $geoanalysis_service;
55
+		$this->geoanalysis_data_service = $geoanalysis_data_service;
56
+	}
57 57
 
58
-    /**
59
-     * {@inheritDoc}
60
-     * @see \Psr\Http\Server\RequestHandlerInterface::handle()
61
-     */
62
-    public function handle(ServerRequestInterface $request): ResponseInterface
63
-    {
64
-        $this->layout = 'layouts/administration';
58
+	/**
59
+	 * {@inheritDoc}
60
+	 * @see \Psr\Http\Server\RequestHandlerInterface::handle()
61
+	 */
62
+	public function handle(ServerRequestInterface $request): ResponseInterface
63
+	{
64
+		$this->layout = 'layouts/administration';
65 65
 
66
-        if ($this->module === null) {
67
-            throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
68
-        }
69
-        $tree = Validator::attributes($request)->tree();
66
+		if ($this->module === null) {
67
+			throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
68
+		}
69
+		$tree = Validator::attributes($request)->tree();
70 70
 
71
-        return $this->viewResponse($this->module->name() . '::admin/view-add', [
72
-            'module'        =>  $this->module,
73
-            'title'         =>  I18N::translate('Add a geographical dispersion analysis view'),
74
-            'tree'          =>  $tree,
75
-            'geoanalysis_list'  =>  $this->geoanalysis_service->all(),
76
-            'place_example'     =>  $this->geoanalysis_data_service->placeHierarchyExample($tree)
77
-        ]);
78
-    }
71
+		return $this->viewResponse($this->module->name() . '::admin/view-add', [
72
+			'module'        =>  $this->module,
73
+			'title'         =>  I18N::translate('Add a geographical dispersion analysis view'),
74
+			'tree'          =>  $tree,
75
+			'geoanalysis_list'  =>  $this->geoanalysis_service->all(),
76
+			'place_example'     =>  $this->geoanalysis_data_service->placeHierarchyExample($tree)
77
+		]);
78
+	}
79 79
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Http/RequestHandlers/MapAdapterEditPage.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -33,68 +33,68 @@
 block discarded – undo
33 33
  */
34 34
 class MapAdapterEditPage implements RequestHandlerInterface
35 35
 {
36
-    use ViewResponseTrait;
36
+	use ViewResponseTrait;
37 37
 
38
-    private ?GeoDispersionModule $module;
39
-    private MapAdapterDataService $mapadapter_data_service;
40
-    private MapDefinitionsService $map_definition_service;
41
-    private PlaceMapperService $place_mapper_service;
38
+	private ?GeoDispersionModule $module;
39
+	private MapAdapterDataService $mapadapter_data_service;
40
+	private MapDefinitionsService $map_definition_service;
41
+	private PlaceMapperService $place_mapper_service;
42 42
 
43
-    /**
44
-     * Constructor for MapAdapterEditPage Request Handler
45
-     *
46
-     * @param ModuleService $module_service
47
-     * @param MapAdapterDataService $mapadapter_data_service
48
-     * @param MapDefinitionsService $map_definition_service
49
-     * @param PlaceMapperService $place_mapper_service
50
-     */
51
-    public function __construct(
52
-        ModuleService $module_service,
53
-        MapAdapterDataService $mapadapter_data_service,
54
-        MapDefinitionsService $map_definition_service,
55
-        PlaceMapperService $place_mapper_service
56
-    ) {
57
-        $this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
58
-        $this->mapadapter_data_service = $mapadapter_data_service;
59
-        $this->map_definition_service = $map_definition_service;
60
-        $this->place_mapper_service = $place_mapper_service;
61
-    }
43
+	/**
44
+	 * Constructor for MapAdapterEditPage Request Handler
45
+	 *
46
+	 * @param ModuleService $module_service
47
+	 * @param MapAdapterDataService $mapadapter_data_service
48
+	 * @param MapDefinitionsService $map_definition_service
49
+	 * @param PlaceMapperService $place_mapper_service
50
+	 */
51
+	public function __construct(
52
+		ModuleService $module_service,
53
+		MapAdapterDataService $mapadapter_data_service,
54
+		MapDefinitionsService $map_definition_service,
55
+		PlaceMapperService $place_mapper_service
56
+	) {
57
+		$this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
58
+		$this->mapadapter_data_service = $mapadapter_data_service;
59
+		$this->map_definition_service = $map_definition_service;
60
+		$this->place_mapper_service = $place_mapper_service;
61
+	}
62 62
 
63
-    /**
64
-     * {@inheritDoc}
65
-     * @see \Psr\Http\Server\RequestHandlerInterface::handle()
66
-     */
67
-    public function handle(ServerRequestInterface $request): ResponseInterface
68
-    {
69
-        $this->layout = 'layouts/administration';
63
+	/**
64
+	 * {@inheritDoc}
65
+	 * @see \Psr\Http\Server\RequestHandlerInterface::handle()
66
+	 */
67
+	public function handle(ServerRequestInterface $request): ResponseInterface
68
+	{
69
+		$this->layout = 'layouts/administration';
70 70
 
71
-        if ($this->module === null) {
72
-            throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
73
-        }
71
+		if ($this->module === null) {
72
+			throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
73
+		}
74 74
 
75
-        $tree = Validator::attributes($request)->tree();
75
+		$tree = Validator::attributes($request)->tree();
76 76
 
77
-        $adapter_id = Validator::attributes($request)->integer('adapter_id', -1);
78
-        $map_adapter = $this->mapadapter_data_service->find($adapter_id);
77
+		$adapter_id = Validator::attributes($request)->integer('adapter_id', -1);
78
+		$map_adapter = $this->mapadapter_data_service->find($adapter_id);
79 79
 
80
-        if ($map_adapter === null) {
81
-            throw new HttpNotFoundException(
82
-                I18N::translate('The map configuration could not be found.')
83
-            );
84
-        }
80
+		if ($map_adapter === null) {
81
+			throw new HttpNotFoundException(
82
+				I18N::translate('The map configuration could not be found.')
83
+			);
84
+		}
85 85
 
86
-        return $this->viewResponse($this->module->name() . '::admin/map-adapter-edit', [
87
-            'module'            =>  $this->module,
88
-            'title'             =>  I18N::translate('Edit the map configuration'),
89
-            'tree'              =>  $tree,
90
-            'view_id'           =>  $map_adapter->geoAnalysisViewId(),
91
-            'map_adapter'       =>  $map_adapter,
92
-            'maps_list'         =>  $this->map_definition_service->all(),
93
-            'mappers_list'      =>  $this->place_mapper_service->all(),
94
-            'route_edit'        =>  route(MapAdapterEditAction::class, [
95
-                                        'tree' => $tree->name(),
96
-                                        'adapter_id' => $map_adapter->id()
97
-                                    ])
98
-        ]);
99
-    }
86
+		return $this->viewResponse($this->module->name() . '::admin/map-adapter-edit', [
87
+			'module'            =>  $this->module,
88
+			'title'             =>  I18N::translate('Edit the map configuration'),
89
+			'tree'              =>  $tree,
90
+			'view_id'           =>  $map_adapter->geoAnalysisViewId(),
91
+			'map_adapter'       =>  $map_adapter,
92
+			'maps_list'         =>  $this->map_definition_service->all(),
93
+			'mappers_list'      =>  $this->place_mapper_service->all(),
94
+			'route_edit'        =>  route(MapAdapterEditAction::class, [
95
+										'tree' => $tree->name(),
96
+										'adapter_id' => $map_adapter->id()
97
+									])
98
+		]);
99
+	}
100 100
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Http/RequestHandlers/AdminConfigPage.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -35,64 +35,64 @@
 block discarded – undo
35 35
  */
36 36
 class AdminConfigPage implements RequestHandlerInterface
37 37
 {
38
-    use ViewResponseTrait;
39
-
40
-    private ?GeoDispersionModule $module;
41
-
42
-    private TreeService $tree_service;
43
-
44
-    private GeoAnalysisDataService $geoanalysis_data_service;
45
-
46
-    /**
47
-     * Constructor for the AdminConfigPage Request Handler
48
-     *
49
-     * @param ModuleService $module_service
50
-     * @param TreeService $tree_service
51
-     * @param GeoAnalysisDataService $geoanalysis_data_service
52
-     */
53
-    public function __construct(
54
-        ModuleService $module_service,
55
-        TreeService $tree_service,
56
-        GeoAnalysisDataService $geoanalysis_data_service
57
-    ) {
58
-        $this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
59
-        $this->tree_service = $tree_service;
60
-        $this->geoanalysis_data_service = $geoanalysis_data_service;
61
-    }
62
-
63
-    /**
64
-     * {@inheritDoc}
65
-     * @see \Psr\Http\Server\RequestHandlerInterface::handle()
66
-     */
67
-    public function handle(ServerRequestInterface $request): ResponseInterface
68
-    {
69
-        $this->layout = 'layouts/administration';
70
-
71
-        if ($this->module === null) {
72
-            throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
73
-        }
74
-
75
-        $user = Validator::attributes($request)->user();
76
-
77
-        $all_trees = $this->tree_service->all()->filter(fn(Tree $tree) => Auth::isManager($tree, $user));
78
-        if ($all_trees->count() === 0) {
79
-            throw new HttpAccessDeniedException();
80
-        }
81
-
82
-        $tree = Validator::attributes($request)->treeOptional() ?? $all_trees->first();
83
-
84
-        $same_tree = fn(Tree $tree_collection): bool => $tree->id() === $tree_collection->id();
85
-        if (!$all_trees->contains($same_tree)) {
86
-            throw new HttpAccessDeniedException();
87
-        }
88
-
89
-        return $this->viewResponse($this->module->name() . '::admin/config', [
90
-            'module_name'       =>  $this->module->name(),
91
-            'title'             =>  $this->module->title(),
92
-            'tree'              =>  $tree,
93
-            'other_trees'       =>  $all_trees->reject($same_tree),
94
-            'place_example'     =>  $this->geoanalysis_data_service->placeHierarchyExample($tree),
95
-            'js_script_url'     =>  $this->module->assetUrl('js/geodispersion.min.js')
96
-        ]);
97
-    }
38
+	use ViewResponseTrait;
39
+
40
+	private ?GeoDispersionModule $module;
41
+
42
+	private TreeService $tree_service;
43
+
44
+	private GeoAnalysisDataService $geoanalysis_data_service;
45
+
46
+	/**
47
+	 * Constructor for the AdminConfigPage Request Handler
48
+	 *
49
+	 * @param ModuleService $module_service
50
+	 * @param TreeService $tree_service
51
+	 * @param GeoAnalysisDataService $geoanalysis_data_service
52
+	 */
53
+	public function __construct(
54
+		ModuleService $module_service,
55
+		TreeService $tree_service,
56
+		GeoAnalysisDataService $geoanalysis_data_service
57
+	) {
58
+		$this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
59
+		$this->tree_service = $tree_service;
60
+		$this->geoanalysis_data_service = $geoanalysis_data_service;
61
+	}
62
+
63
+	/**
64
+	 * {@inheritDoc}
65
+	 * @see \Psr\Http\Server\RequestHandlerInterface::handle()
66
+	 */
67
+	public function handle(ServerRequestInterface $request): ResponseInterface
68
+	{
69
+		$this->layout = 'layouts/administration';
70
+
71
+		if ($this->module === null) {
72
+			throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
73
+		}
74
+
75
+		$user = Validator::attributes($request)->user();
76
+
77
+		$all_trees = $this->tree_service->all()->filter(fn(Tree $tree) => Auth::isManager($tree, $user));
78
+		if ($all_trees->count() === 0) {
79
+			throw new HttpAccessDeniedException();
80
+		}
81
+
82
+		$tree = Validator::attributes($request)->treeOptional() ?? $all_trees->first();
83
+
84
+		$same_tree = fn(Tree $tree_collection): bool => $tree->id() === $tree_collection->id();
85
+		if (!$all_trees->contains($same_tree)) {
86
+			throw new HttpAccessDeniedException();
87
+		}
88
+
89
+		return $this->viewResponse($this->module->name() . '::admin/config', [
90
+			'module_name'       =>  $this->module->name(),
91
+			'title'             =>  $this->module->title(),
92
+			'tree'              =>  $tree,
93
+			'other_trees'       =>  $all_trees->reject($same_tree),
94
+			'place_example'     =>  $this->geoanalysis_data_service->placeHierarchyExample($tree),
95
+			'js_script_url'     =>  $this->module->assetUrl('js/geodispersion.min.js')
96
+		]);
97
+	}
98 98
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Http/RequestHandlers/MapAdapterMapperConfig.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -33,67 +33,67 @@
 block discarded – undo
33 33
  */
34 34
 class MapAdapterMapperConfig implements RequestHandlerInterface
35 35
 {
36
-    use ViewResponseTrait;
36
+	use ViewResponseTrait;
37 37
 
38
-    private ?GeoDispersionModule $module;
39
-    private MapAdapterDataService $mapadapter_data_service;
38
+	private ?GeoDispersionModule $module;
39
+	private MapAdapterDataService $mapadapter_data_service;
40 40
 
41
-    /**
42
-     * Constructor for MapAdapterMapperConfig Request Handler
43
-     *
44
-     * @param ModuleService $module_service
45
-     * @param MapAdapterDataService $mapadapter_data_service
46
-     */
47
-    public function __construct(
48
-        ModuleService $module_service,
49
-        MapAdapterDataService $mapadapter_data_service
50
-    ) {
51
-        $this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
52
-        $this->mapadapter_data_service = $mapadapter_data_service;
53
-    }
41
+	/**
42
+	 * Constructor for MapAdapterMapperConfig Request Handler
43
+	 *
44
+	 * @param ModuleService $module_service
45
+	 * @param MapAdapterDataService $mapadapter_data_service
46
+	 */
47
+	public function __construct(
48
+		ModuleService $module_service,
49
+		MapAdapterDataService $mapadapter_data_service
50
+	) {
51
+		$this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
52
+		$this->mapadapter_data_service = $mapadapter_data_service;
53
+	}
54 54
 
55
-    /**
56
-     * {@inheritDoc}
57
-     * @see \Psr\Http\Server\RequestHandlerInterface::handle()
58
-     */
59
-    public function handle(ServerRequestInterface $request): ResponseInterface
60
-    {
61
-        $this->layout = 'layouts/ajax';
55
+	/**
56
+	 * {@inheritDoc}
57
+	 * @see \Psr\Http\Server\RequestHandlerInterface::handle()
58
+	 */
59
+	public function handle(ServerRequestInterface $request): ResponseInterface
60
+	{
61
+		$this->layout = 'layouts/ajax';
62 62
 
63
-        if ($this->module === null) {
64
-            throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
65
-        }
66
-        $tree = Validator::attributes($request)->tree();
63
+		if ($this->module === null) {
64
+			throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
65
+		}
66
+		$tree = Validator::attributes($request)->tree();
67 67
 
68
-        $adapter_id = Validator::attributes($request)->integer('adapter_id', -1);
69
-        $map_adapter = $this->mapadapter_data_service->find($adapter_id);
68
+		$adapter_id = Validator::attributes($request)->integer('adapter_id', -1);
69
+		$map_adapter = $this->mapadapter_data_service->find($adapter_id);
70 70
 
71
-        $mapper_class = Validator::queryParams($request)->string('mapper', '');
72
-        $mapper = null;
73
-        if ($mapper_class === '' && $map_adapter !== null) {
74
-            $mapper = $map_adapter->placeMapper();
75
-        } else {
76
-            try {
77
-                $mapper = app($mapper_class);
78
-            } catch (BindingResolutionException $ex) {
79
-            }
71
+		$mapper_class = Validator::queryParams($request)->string('mapper', '');
72
+		$mapper = null;
73
+		if ($mapper_class === '' && $map_adapter !== null) {
74
+			$mapper = $map_adapter->placeMapper();
75
+		} else {
76
+			try {
77
+				$mapper = app($mapper_class);
78
+			} catch (BindingResolutionException $ex) {
79
+			}
80 80
 
81
-            if (
82
-                $mapper !== null && $map_adapter !== null &&
83
-                get_class($map_adapter->placeMapper()) === get_class($mapper)
84
-            ) {
85
-                $mapper = $map_adapter->placeMapper();
86
-            }
87
-        }
81
+			if (
82
+				$mapper !== null && $map_adapter !== null &&
83
+				get_class($map_adapter->placeMapper()) === get_class($mapper)
84
+			) {
85
+				$mapper = $map_adapter->placeMapper();
86
+			}
87
+		}
88 88
 
89
-        if ($mapper === null || !($mapper instanceof PlaceMapperInterface)) {
90
-            throw new HttpNotFoundException(
91
-                I18N::translate('The configuration for the place mapper could not be found.')
92
-            );
93
-        }
89
+		if ($mapper === null || !($mapper instanceof PlaceMapperInterface)) {
90
+			throw new HttpNotFoundException(
91
+				I18N::translate('The configuration for the place mapper could not be found.')
92
+			);
93
+		}
94 94
 
95
-        return $this->viewResponse('layouts/ajax', [
96
-            'content' => $mapper->config()->configContent($this->module, $tree)
97
-        ]);
98
-    }
95
+		return $this->viewResponse('layouts/ajax', [
96
+			'content' => $mapper->config()->configContent($this->module, $tree)
97
+		]);
98
+	}
99 99
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Http/RequestHandlers/MapAdapterAddPage.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -33,68 +33,68 @@
 block discarded – undo
33 33
  */
34 34
 class MapAdapterAddPage implements RequestHandlerInterface
35 35
 {
36
-    use ViewResponseTrait;
36
+	use ViewResponseTrait;
37 37
 
38
-    private ?GeoDispersionModule $module;
39
-    private GeoAnalysisViewDataService $geoview_data_service;
40
-    private MapDefinitionsService $map_definition_service;
41
-    private PlaceMapperService $place_mapper_service;
38
+	private ?GeoDispersionModule $module;
39
+	private GeoAnalysisViewDataService $geoview_data_service;
40
+	private MapDefinitionsService $map_definition_service;
41
+	private PlaceMapperService $place_mapper_service;
42 42
 
43
-    /**
44
-     * Constructor for MapAdapterAddPage Request Handler
45
-     *
46
-     * @param ModuleService $module_service
47
-     * @param GeoAnalysisViewDataService $geoview_data_service
48
-     * @param MapDefinitionsService $map_definition_service
49
-     * @param PlaceMapperService $place_mapper_service
50
-     */
51
-    public function __construct(
52
-        ModuleService $module_service,
53
-        GeoAnalysisViewDataService $geoview_data_service,
54
-        MapDefinitionsService $map_definition_service,
55
-        PlaceMapperService $place_mapper_service
56
-    ) {
57
-        $this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
58
-        $this->geoview_data_service = $geoview_data_service;
59
-        $this->map_definition_service = $map_definition_service;
60
-        $this->place_mapper_service = $place_mapper_service;
61
-    }
43
+	/**
44
+	 * Constructor for MapAdapterAddPage Request Handler
45
+	 *
46
+	 * @param ModuleService $module_service
47
+	 * @param GeoAnalysisViewDataService $geoview_data_service
48
+	 * @param MapDefinitionsService $map_definition_service
49
+	 * @param PlaceMapperService $place_mapper_service
50
+	 */
51
+	public function __construct(
52
+		ModuleService $module_service,
53
+		GeoAnalysisViewDataService $geoview_data_service,
54
+		MapDefinitionsService $map_definition_service,
55
+		PlaceMapperService $place_mapper_service
56
+	) {
57
+		$this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
58
+		$this->geoview_data_service = $geoview_data_service;
59
+		$this->map_definition_service = $map_definition_service;
60
+		$this->place_mapper_service = $place_mapper_service;
61
+	}
62 62
 
63
-    /**
64
-     * {@inheritDoc}
65
-     * @see \Psr\Http\Server\RequestHandlerInterface::handle()
66
-     */
67
-    public function handle(ServerRequestInterface $request): ResponseInterface
68
-    {
69
-        $this->layout = 'layouts/administration';
63
+	/**
64
+	 * {@inheritDoc}
65
+	 * @see \Psr\Http\Server\RequestHandlerInterface::handle()
66
+	 */
67
+	public function handle(ServerRequestInterface $request): ResponseInterface
68
+	{
69
+		$this->layout = 'layouts/administration';
70 70
 
71
-        if ($this->module === null) {
72
-            throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
73
-        }
71
+		if ($this->module === null) {
72
+			throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
73
+		}
74 74
 
75
-        $tree = Validator::attributes($request)->tree();
75
+		$tree = Validator::attributes($request)->tree();
76 76
 
77
-        $view_id = Validator::attributes($request)->integer('view_id', -1);
78
-        $view = $this->geoview_data_service->find($tree, $view_id, true);
77
+		$view_id = Validator::attributes($request)->integer('view_id', -1);
78
+		$view = $this->geoview_data_service->find($tree, $view_id, true);
79 79
 
80
-        if ($view === null) {
81
-            throw new HttpNotFoundException(
82
-                I18N::translate('The geographical dispersion analysis view could not be found.')
83
-            );
84
-        }
80
+		if ($view === null) {
81
+			throw new HttpNotFoundException(
82
+				I18N::translate('The geographical dispersion analysis view could not be found.')
83
+			);
84
+		}
85 85
 
86
-        return $this->viewResponse($this->module->name() . '::admin/map-adapter-edit', [
87
-            'module'            =>  $this->module,
88
-            'title'             =>  I18N::translate('Add a map configuration'),
89
-            'tree'              =>  $tree,
90
-            'view_id'           =>  $view_id,
91
-            'map_adapter'       =>  null,
92
-            'maps_list'         =>  $this->map_definition_service->all(),
93
-            'mappers_list'      =>  $this->place_mapper_service->all(),
94
-            'route_edit'        =>  route(MapAdapterAddAction::class, [
95
-                                        'tree'      => $tree->name(),
96
-                                        'view_id'   => $view_id
97
-                                    ])
98
-        ]);
99
-    }
86
+		return $this->viewResponse($this->module->name() . '::admin/map-adapter-edit', [
87
+			'module'            =>  $this->module,
88
+			'title'             =>  I18N::translate('Add a map configuration'),
89
+			'tree'              =>  $tree,
90
+			'view_id'           =>  $view_id,
91
+			'map_adapter'       =>  null,
92
+			'maps_list'         =>  $this->map_definition_service->all(),
93
+			'mappers_list'      =>  $this->place_mapper_service->all(),
94
+			'route_edit'        =>  route(MapAdapterAddAction::class, [
95
+										'tree'      => $tree->name(),
96
+										'view_id'   => $view_id
97
+									])
98
+		]);
99
+	}
100 100
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Http/RequestHandlers/GeoAnalysisViewPage.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -32,42 +32,42 @@
 block discarded – undo
32 32
  */
33 33
 class GeoAnalysisViewPage implements RequestHandlerInterface
34 34
 {
35
-    use ViewResponseTrait;
35
+	use ViewResponseTrait;
36 36
 
37
-    private ?GeoDispersionModule $module;
38
-    private GeoAnalysisViewDataService $geoviewdata_service;
37
+	private ?GeoDispersionModule $module;
38
+	private GeoAnalysisViewDataService $geoviewdata_service;
39 39
 
40
-    /**
41
-     * Constructor for GeoAnalysisViewPage Request Handler
42
-     *
43
-     * @param ModuleService $module_service
44
-     */
45
-    public function __construct(
46
-        ModuleService $module_service,
47
-        GeoAnalysisViewDataService $geoviewdata_service
48
-    ) {
49
-        $this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
50
-        $this->geoviewdata_service = $geoviewdata_service;
51
-    }
40
+	/**
41
+	 * Constructor for GeoAnalysisViewPage Request Handler
42
+	 *
43
+	 * @param ModuleService $module_service
44
+	 */
45
+	public function __construct(
46
+		ModuleService $module_service,
47
+		GeoAnalysisViewDataService $geoviewdata_service
48
+	) {
49
+		$this->module = $module_service->findByInterface(GeoDispersionModule::class)->first();
50
+		$this->geoviewdata_service = $geoviewdata_service;
51
+	}
52 52
 
53
-    /**
54
-     * {@inheritDoc}
55
-     * @see \Psr\Http\Server\RequestHandlerInterface::handle()
56
-     */
57
-    public function handle(ServerRequestInterface $request): ResponseInterface
58
-    {
59
-        if ($this->module === null) {
60
-            throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
61
-        }
53
+	/**
54
+	 * {@inheritDoc}
55
+	 * @see \Psr\Http\Server\RequestHandlerInterface::handle()
56
+	 */
57
+	public function handle(ServerRequestInterface $request): ResponseInterface
58
+	{
59
+		if ($this->module === null) {
60
+			throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
61
+		}
62 62
 
63
-        $tree = Validator::attributes($request)->tree();
64
-        $view_id = Validator::attributes($request)->integer('view_id', 0);
63
+		$tree = Validator::attributes($request)->tree();
64
+		$view_id = Validator::attributes($request)->integer('view_id', 0);
65 65
 
66
-        return $this->viewResponse($this->module->name() . '::geoanalysisview-page', [
67
-            'module_name'           =>  $this->module->name(),
68
-            'title'                 =>  I18N::translate('Geographical dispersion'),
69
-            'tree'                  =>  $tree,
70
-            'view'                  =>  $this->geoviewdata_service->find($tree, $view_id)
71
-        ]);
72
-    }
66
+		return $this->viewResponse($this->module->name() . '::geoanalysisview-page', [
67
+			'module_name'           =>  $this->module->name(),
68
+			'title'                 =>  I18N::translate('Geographical dispersion'),
69
+			'tree'                  =>  $tree,
70
+			'view'                  =>  $this->geoviewdata_service->find($tree, $view_id)
71
+		]);
72
+	}
73 73
 }
Please login to merge, or discard this patch.