Skip to content

Commit

Permalink
!fixup 5397ebd
Browse files Browse the repository at this point in the history
  • Loading branch information
d0m4te committed Dec 27, 2023
1 parent 5397ebd commit 7f99f56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Traits/HasSpatial.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace MatanYadaev\EloquentSpatial\Traits;

use MatanYadaev\EloquentSpatial\Objects\Geometry;
use MatanYadaev\EloquentSpatial\SpatialBuilder;
use MatanYadaev\EloquentSpatial\Objects\Geometry;

trait HasSpatial
{
Expand All @@ -12,6 +12,9 @@ public function newEloquentBuilder($query): SpatialBuilder
return new SpatialBuilder($query);
}

/**
* @param array<string, mixed> $attributes
*/
public function setRawAttributes(array $attributes, $sync = false)
{
$result = parent::setRawAttributes($attributes, $sync);
Expand Down
4 changes: 4 additions & 0 deletions tests/GeometryCastTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
$serialized = serialize($testPlace);
$json = json_encode($serialized);

expect($json)->toBeTruthy('JSON enxoding failed.');

// @phpstan-ignore-next-line
$recoveredTestPlace = unserialize(json_decode($json));

expect($recoveredTestPlace)->toEqual($testPlace);
Expand All @@ -156,6 +159,7 @@

expect($json)->toBeTruthy('JSON encoding failed.');

// @phpstan-ignore-next-line
$recoveredTestPlace = unserialize(json_decode($json));

expect($recoveredTestPlace)->toEqual($testPlaceFromDb);
Expand Down

0 comments on commit 7f99f56

Please sign in to comment.