Skip to content

Commit

Permalink
move invalid argument exception to same interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladyslav Yarysh committed Dec 4, 2023
1 parent 845c70b commit 89e17fb
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/BoundingBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace GeoJson;

use GeoJson\Exception\InvalidArgumentException;
use GeoJson\Exception\UnserializationException;
use InvalidArgumentException;
use JsonSerializable;

use function count;
Expand Down
9 changes: 9 additions & 0 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace GeoJson\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements Exception

Check failure on line 7 in src/Exception/InvalidArgumentException.php

View workflow job for this annotation

GitHub Actions / Coding Standards (7.4)

Class \InvalidArgumentException should not be referenced via a fully qualified name, but via a use statement.
{
}
2 changes: 1 addition & 1 deletion src/Feature/FeatureCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Countable;
use GeoJson\BoundingBox;
use GeoJson\CoordinateReferenceSystem\CoordinateReferenceSystem;
use GeoJson\Exception\InvalidArgumentException;
use GeoJson\GeoJson;
use InvalidArgumentException;
use IteratorAggregate;
use Traversable;

Expand Down
2 changes: 1 addition & 1 deletion src/Geometry/GeometryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Countable;
use GeoJson\BoundingBox;
use GeoJson\CoordinateReferenceSystem\CoordinateReferenceSystem;
use InvalidArgumentException;
use GeoJson\Exception\InvalidArgumentException;
use IteratorAggregate;
use Traversable;

Expand Down
2 changes: 1 addition & 1 deletion src/Geometry/LineString.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use GeoJson\BoundingBox;
use GeoJson\CoordinateReferenceSystem\CoordinateReferenceSystem;
use InvalidArgumentException;
use GeoJson\Exception\InvalidArgumentException;

use function count;

Expand Down
2 changes: 1 addition & 1 deletion src/Geometry/LinearRing.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use GeoJson\BoundingBox;
use GeoJson\CoordinateReferenceSystem\CoordinateReferenceSystem;
use InvalidArgumentException;
use GeoJson\Exception\InvalidArgumentException;

use function count;
use function end;
Expand Down
2 changes: 1 addition & 1 deletion src/Geometry/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use GeoJson\BoundingBox;
use GeoJson\CoordinateReferenceSystem\CoordinateReferenceSystem;
use InvalidArgumentException;
use GeoJson\Exception\InvalidArgumentException;

use function count;
use function is_float;
Expand Down
2 changes: 1 addition & 1 deletion tests/BoundingBoxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace GeoJson\Tests;

use GeoJson\BoundingBox;
use GeoJson\Exception\InvalidArgumentException;
use GeoJson\Exception\UnserializationException;
use GeoJson\JsonUnserializable;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use stdClass;

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/FeatureCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace GeoJson\Tests\Feature;

use GeoJson\Exception\InvalidArgumentException;
use GeoJson\Exception\UnserializationException;
use GeoJson\Feature\Feature;
use GeoJson\Feature\FeatureCollection;
use GeoJson\GeoJson;
use GeoJson\Geometry\Point;
use GeoJson\Tests\BaseGeoJsonTest;
use InvalidArgumentException;
use stdClass;

use function is_subclass_of;
Expand Down
2 changes: 1 addition & 1 deletion tests/Geometry/GeometryCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace GeoJson\Tests\Geometry;

use GeoJson\Exception\InvalidArgumentException;
use GeoJson\Exception\UnserializationException;
use GeoJson\GeoJson;
use GeoJson\Geometry\Geometry;
use GeoJson\Geometry\GeometryCollection;
use GeoJson\Geometry\Point;
use GeoJson\Tests\BaseGeoJsonTest;
use InvalidArgumentException;
use stdClass;

use function is_subclass_of;
Expand Down
2 changes: 1 addition & 1 deletion tests/Geometry/LineStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace GeoJson\Tests\Geometry;

use GeoJson\Exception\InvalidArgumentException;
use GeoJson\GeoJson;
use GeoJson\Geometry\LineString;
use GeoJson\Geometry\MultiPoint;
use GeoJson\Tests\BaseGeoJsonTest;
use InvalidArgumentException;

use function is_subclass_of;
use function json_decode;
Expand Down
7 changes: 3 additions & 4 deletions tests/Geometry/LinearRingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

namespace GeoJson\Tests\Geometry;

use GeoJson\GeoJson;
use GeoJson\Exception\InvalidArgumentException;
use GeoJson\Geometry\LinearRing;
use GeoJson\Geometry\LineString;
use GeoJson\Geometry\Point;
use GeoJson\Tests\BaseGeoJsonTest;
use InvalidArgumentException;

use function is_subclass_of;

Expand Down Expand Up @@ -72,11 +71,11 @@ public function testSerialization(): void
$linearRing = new LinearRing($coordinates);

$expected = [
'type' => 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());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Geometry/PointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 89e17fb

Please sign in to comment.