Skip to content

Commit 720de70

Browse files
committed
Upgrade phpmyadmin/shapefile
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
1 parent 7bd2394 commit 720de70

2 files changed

Lines changed: 49 additions & 49 deletions

File tree

composer.lock

Lines changed: 42 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Plugins/Import/ImportShp.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use PhpMyAdmin\Plugins\ImportPlugin;
2525
use PhpMyAdmin\Properties\Plugins\ImportPluginProperties;
2626
use PhpMyAdmin\Sanitize;
27+
use PhpMyAdmin\ShapeFile\ShapeType;
2728
use PhpMyAdmin\ZipExtension;
2829
use ZipArchive;
2930

@@ -99,7 +100,7 @@ public function doImport(File|null $importHandle = null): array
99100

100101
$compression = $importHandle->getCompression();
101102

102-
$shp = new ShapeFileImport(1);
103+
$shp = new ShapeFileImport(ShapeType::Point);
103104
// If the zip archive has more than one file,
104105
// get the correct content to the buffer from .shp file.
105106
if (
@@ -183,23 +184,18 @@ public function doImport(File|null $importHandle = null): array
183184
}
184185

185186
switch ($shp->shapeType) {
186-
// ESRI Null Shape
187-
case 0:
187+
case ShapeType::Null:
188188
break;
189-
// ESRI Point
190-
case 1:
189+
case ShapeType::Point:
191190
$gisType = 'point';
192191
break;
193-
// ESRI PolyLine
194-
case 3:
192+
case ShapeType::PolyLine:
195193
$gisType = 'multilinestring';
196194
break;
197-
// ESRI Polygon
198-
case 5:
195+
case ShapeType::Polygon:
199196
$gisType = 'multipolygon';
200197
break;
201-
// ESRI MultiPoint
202-
case 8:
198+
case ShapeType::MultiPoint:
203199
$gisType = 'multipoint';
204200
break;
205201
default:

0 commit comments

Comments
 (0)