@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @var array<string, string> |
| 37 | 37 | */ |
| 38 | - private const MAPPINGS_REGIONS = [ |
|
| 38 | + private const MAPPINGS_REGIONS=[ |
|
| 39 | 39 | 'Auvergne' => 'Auvergne-Rhône-Alpes', |
| 40 | 40 | 'Rhône-Alpes' => 'Auvergne-Rhône-Alpes', |
| 41 | 41 | 'Bourgogne' => 'Bourgogne-Franche-Comté', |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * @var array<string, string> |
| 63 | 63 | */ |
| 64 | - private const MAPPINGS_DEPARTEMENTS = [ |
|
| 64 | + private const MAPPINGS_DEPARTEMENTS=[ |
|
| 65 | 65 | 'Basses-Alpes' => 'Alpes-de-Haute-Provence', |
| 66 | 66 | 'Basses-Pyrénées' => 'Pyrénées-Atlantiques', |
| 67 | 67 | 'Charente-Inférieure' => 'Charente-Maritime', |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * |
| 76 | 76 | * @var array<string, string> |
| 77 | 77 | */ |
| 78 | - private const MAPPINGS_KNOWN_COMMUNES_VARIATIONS = [ |
|
| 78 | + private const MAPPINGS_KNOWN_COMMUNES_VARIATIONS=[ |
|
| 79 | 79 | 'Sarrus (Fridefont)' => 'Fridefont', |
| 80 | 80 | 'Magnac (Fridefont)' => 'Fridefont', |
| 81 | 81 | 'Mallet (Fridefont)' => 'Fridefont', |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * @var array<string, mixed> |
| 90 | 90 | */ |
| 91 | - private array $data = []; |
|
| 91 | + private array $data=[]; |
|
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | 94 | * {@inheritDoc} |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function setData(string $key, $data): void |
| 116 | 116 | { |
| 117 | - $this->data[$key] = $data; |
|
| 117 | + $this->data[$key]=$data; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -148,16 +148,16 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function map(Place $place, string $feature_property): ?string |
| 150 | 150 | { |
| 151 | - $map_def = $this->data('map'); |
|
| 151 | + $map_def=$this->data('map'); |
|
| 152 | 152 | if ($map_def === null || !($map_def instanceof MapDefinitionInterface)) { |
| 153 | 153 | return null; |
| 154 | 154 | } |
| 155 | - $place_mappings = Registry::cache()->array()->remember( |
|
| 156 | - SimpleFrancePlaceMapper::class . '-mapping-' . $map_def->id(), |
|
| 155 | + $place_mappings=Registry::cache()->array()->remember( |
|
| 156 | + SimpleFrancePlaceMapper::class.'-mapping-'.$map_def->id(), |
|
| 157 | 157 | fn(): array => $this->mappingsForMap($map_def->id()) |
| 158 | 158 | ); |
| 159 | 159 | |
| 160 | - $place_name = $place->firstParts(1)->first(); |
|
| 160 | + $place_name=$place->firstParts(1)->first(); |
|
| 161 | 161 | return $place_mappings[$place_name] ?? $place_name; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | private function mappingsForMap(string $map_id): array |
| 185 | 185 | { |
| 186 | - $mapping = []; |
|
| 186 | + $mapping=[]; |
|
| 187 | 187 | if ($this->endsWith($map_id, '-departements')) { |
| 188 | 188 | return self::MAPPINGS_DEPARTEMENTS; |
| 189 | 189 | } |
@@ -193,20 +193,20 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | if (mb_strpos($map_id, '-communes') !== false) { |
| 196 | - $mapping = self::MAPPINGS_KNOWN_COMMUNES_VARIATIONS; |
|
| 196 | + $mapping=self::MAPPINGS_KNOWN_COMMUNES_VARIATIONS; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if ($this->endsWith($map_id, '-communes')) { |
| 200 | - $module = app(ModuleService::class)->findByInterface(GeoDataFranceModule::class)->first(); |
|
| 200 | + $module=app(ModuleService::class)->findByInterface(GeoDataFranceModule::class)->first(); |
|
| 201 | 201 | if ($module === null) { |
| 202 | 202 | return $mapping; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - $file = $module->resourcesFolder() . '/mappings/new-communes.php'; |
|
| 205 | + $file=$module->resourcesFolder().'/mappings/new-communes.php'; |
|
| 206 | 206 | if (!is_file($file)) { |
| 207 | 207 | return $mapping; |
| 208 | 208 | } |
| 209 | - $mappings_new_communes = include $file; |
|
| 209 | + $mappings_new_communes=include $file; |
|
| 210 | 210 | if (!is_array($mappings_new_communes)) { |
| 211 | 211 | return $mapping; |
| 212 | 212 | } |
@@ -81,20 +81,20 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function listMapDefinition(): array |
| 83 | 83 | { |
| 84 | - $filesystem = new Filesystem(new LocalFilesystemAdapter($this->resourcesFolder() . 'maps/')); |
|
| 84 | + $filesystem=new Filesystem(new LocalFilesystemAdapter($this->resourcesFolder().'maps/')); |
|
| 85 | 85 | |
| 86 | 86 | //phpcs:disable Generic.Files.LineLength.TooLong |
| 87 | 87 | return array_merge( |
| 88 | 88 | [ |
| 89 | 89 | new SimpleFilesystemMap( |
| 90 | 90 | 'fr-metropole-regions-2016', |
| 91 | - I18N::translate('Metropolitan France by region') . ' (2016-)', |
|
| 91 | + I18N::translate('Metropolitan France by region').' (2016-)', |
|
| 92 | 92 | $filesystem, |
| 93 | 93 | 'metropole-regions-2016.geojson' |
| 94 | 94 | ), |
| 95 | 95 | new SimpleFilesystemMap( |
| 96 | 96 | 'fr-metropole-regions-1970', |
| 97 | - I18N::translate('Metropolitan France by region') . ' (1970-2015)', |
|
| 97 | + I18N::translate('Metropolitan France by region').' (1970-2015)', |
|
| 98 | 98 | $filesystem, |
| 99 | 99 | 'metropole-regions-1970.geojson' |
| 100 | 100 | ), |
@@ -106,19 +106,19 @@ discard block |
||
| 106 | 106 | ), |
| 107 | 107 | new SimpleFilesystemMap( |
| 108 | 108 | 'fr-area-aubrac-lot-margeride-planeze-communes', |
| 109 | - I18N::translate('%s by municipality', 'Aubrac-Margeride-Planèze-Vallée du Lot') . ' - ' . I18N::translate('Latest'), |
|
| 109 | + I18N::translate('%s by municipality', 'Aubrac-Margeride-Planèze-Vallée du Lot').' - '.I18N::translate('Latest'), |
|
| 110 | 110 | $filesystem, |
| 111 | 111 | 'areas/aubrac-lot-margeride-planeze/communes-latest.geojson' |
| 112 | 112 | ), |
| 113 | 113 | new SimpleFilesystemMap( |
| 114 | 114 | 'fr-area-aubrac-lot-margeride-planeze-communes-2011', |
| 115 | - I18N::translate('%s by municipality', 'Aubrac-Margeride-Planèze-Vallée du Lot') . ' - 2011', |
|
| 115 | + I18N::translate('%s by municipality', 'Aubrac-Margeride-Planèze-Vallée du Lot').' - 2011', |
|
| 116 | 116 | $filesystem, |
| 117 | 117 | 'areas/aubrac-lot-margeride-planeze/communes-2011.geojson' |
| 118 | 118 | ), |
| 119 | 119 | new SimpleFilesystemMap( |
| 120 | 120 | 'fr-area-aubrac-lot-margeride-planeze-codespostaux', |
| 121 | - I18N::translate('%s by zip code', 'Aubrac-Margeride-Planèze-Vallée du Lot') . ' - ' . I18N::translate('Latest'), |
|
| 121 | + I18N::translate('%s by zip code', 'Aubrac-Margeride-Planèze-Vallée du Lot').' - '.I18N::translate('Latest'), |
|
| 122 | 122 | $filesystem, |
| 123 | 123 | 'areas/aubrac-lot-margeride-planeze/codespostaux-latest.geojson' |
| 124 | 124 | ) |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -return array ( |
|
| 13 | +return array( |
|
| 14 | 14 | |
| 15 | 15 | 'Geographical data - France' => 'Données géographiques - France', |
| 16 | 16 | 'Data to be used in geographical data analysis - France' |