Skip to content

Commit

Permalink
Update Polygon.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dash8x authored May 29, 2024
1 parent f917a7d commit 67c9fbd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Objects/Polygon.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Javaabu\Geospatial\Factory;
use Javaabu\Geospatial\GeometryCast;
use Javaabu\Geospatial\Geospatial;
use MatanYadaev\EloquentSpatial\Enums\Srid;
use MatanYadaev\EloquentSpatial\GeometryExpression;

class Polygon extends \MatanYadaev\EloquentSpatial\Objects\Polygon
Expand All @@ -32,7 +31,7 @@ public static function castUsing(array $arguments): CastsAttributes
return new GeometryCast(static::class);
}

public static function fromWkt(string $wkt, int|Srid $srid = 0): static
public static function fromWkt(string $wkt, int $srid = 0): static
{
$wkt = Str::upper($wkt);

Expand All @@ -41,7 +40,7 @@ public static function fromWkt(string $wkt, int|Srid $srid = 0): static
}

$geometry = Factory::parse($wkt);
$geometry->srid = $srid instanceof Srid ? $srid->value : $srid;
$geometry->srid = $srid;

if (! ($geometry instanceof static)) {
throw new InvalidArgumentException(
Expand Down

0 comments on commit 67c9fbd

Please sign in to comment.