From 89e17fb0e3b8490b7c8360391676f104784f9bfc Mon Sep 17 00:00:00 2001 From: Vladyslav Yarysh Date: Mon, 4 Dec 2023 15:12:35 +0200 Subject: [PATCH] move invalid argument exception to same interface --- src/BoundingBox.php | 2 +- src/Exception/InvalidArgumentException.php | 9 +++++++++ src/Feature/FeatureCollection.php | 2 +- src/Geometry/GeometryCollection.php | 2 +- src/Geometry/LineString.php | 2 +- src/Geometry/LinearRing.php | 2 +- src/Geometry/Point.php | 2 +- tests/BoundingBoxTest.php | 2 +- tests/Feature/FeatureCollectionTest.php | 2 +- tests/Geometry/GeometryCollectionTest.php | 2 +- tests/Geometry/LineStringTest.php | 2 +- tests/Geometry/LinearRingTest.php | 7 +++---- tests/Geometry/PointTest.php | 2 +- 13 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 src/Exception/InvalidArgumentException.php diff --git a/src/BoundingBox.php b/src/BoundingBox.php index cf9eda9..c199bb0 100644 --- a/src/BoundingBox.php +++ b/src/BoundingBox.php @@ -4,8 +4,8 @@ namespace GeoJson; +use GeoJson\Exception\InvalidArgumentException; use GeoJson\Exception\UnserializationException; -use InvalidArgumentException; use JsonSerializable; use function count; diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php new file mode 100644 index 0000000..5fff0d1 --- /dev/null +++ b/src/Exception/InvalidArgumentException.php @@ -0,0 +1,9 @@ + GeoJson::TYPE_LINE_STRING, + 'type' => 'LineString', 'coordinates' => $coordinates, ]; - $this->assertSame(GeoJson::TYPE_LINE_STRING, $linearRing->getType()); + $this->assertSame('LineString', $linearRing->getType()); $this->assertSame($coordinates, $linearRing->getCoordinates()); $this->assertSame($expected, $linearRing->jsonSerialize()); } diff --git a/tests/Geometry/PointTest.php b/tests/Geometry/PointTest.php index d5df870..a3acbe6 100644 --- a/tests/Geometry/PointTest.php +++ b/tests/Geometry/PointTest.php @@ -4,11 +4,11 @@ namespace GeoJson\Tests\Geometry; +use GeoJson\Exception\InvalidArgumentException; use GeoJson\GeoJson; use GeoJson\Geometry\Geometry; use GeoJson\Geometry\Point; use GeoJson\Tests\BaseGeoJsonTest; -use InvalidArgumentException; use stdClass; use function func_get_args;