Skip to content

Commit 0b9149b

Browse files
committed
pint
1 parent 009d4fa commit 0b9149b

File tree

10 files changed

+13
-23
lines changed

10 files changed

+13
-23
lines changed

src/Eloquent/GeometryCast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function get(Model $model, string $key, mixed $value, array $attributes):
5050
*
5151
* @throws LaravelSpatialException
5252
*/
53-
public function set(Model $model, string $key, mixed $value, array $attributes): Expression|null
53+
public function set(Model $model, string $key, mixed $value, array $attributes): ?Expression
5454
{
5555
if (! $value) {
5656
return null;

src/Eloquent/HasSpatial.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace ASanikovich\LaravelSpatial\Eloquent;
44

55
use ASanikovich\LaravelSpatial\Geometry\Geometry;
6-
use Illuminate\Database\Eloquent\Builder;
76
use Illuminate\Contracts\Database\Query\Expression;
7+
use Illuminate\Database\Eloquent\Builder;
88

99
/**
1010
* @method static withDistance(Expression|Geometry|string $column, Expression|Geometry|string $geometryOrColumn, string $alias = 'distance')

src/Exceptions/LaravelSpatialException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use DomainException;
88

9-
class LaravelSpatialException extends DomainException
10-
{
11-
}
9+
class LaravelSpatialException extends DomainException {}

src/Exceptions/LaravelSpatialJsonException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
namespace ASanikovich\LaravelSpatial\Exceptions;
66

7-
class LaravelSpatialJsonException extends LaravelSpatialException
8-
{
9-
}
7+
class LaravelSpatialJsonException extends LaravelSpatialException {}

src/Geometry/Geometry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use Throwable;
2424
use WKB as geoPHPWkb;
2525

26-
abstract class Geometry implements Castable, Arrayable, Jsonable, JsonSerializable, Stringable
26+
abstract class Geometry implements Arrayable, Castable, Jsonable, JsonSerializable, Stringable
2727
{
2828
use Macroable;
2929

@@ -189,7 +189,7 @@ public function toSqlExpression(ConnectionInterface $connection): Expression
189189
{
190190
$wkt = $this->toWkt();
191191

192-
if (! (new Connection())->isSupportAxisOrder($connection)) {
192+
if (! (new Connection)->isSupportAxisOrder($connection)) {
193193
// @codeCoverageIgnoreStart
194194
return DB::raw(sprintf("ST_GeomFromText('%s', %d)", $wkt, $this->srid));
195195
// @codeCoverageIgnoreEnd

tests/Custom/CustomPoint.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use ASanikovich\LaravelSpatial\Geometry\Point;
88

9-
class CustomPoint extends Point
10-
{
11-
}
9+
class CustomPoint extends Point {}

tests/Custom/CustomPointConfig.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use ASanikovich\LaravelSpatial\Geometry\Point;
88

9-
class CustomPointConfig extends Point
10-
{
11-
}
9+
class CustomPointConfig extends Point {}

tests/Custom/CustomPointInvalid.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
namespace ASanikovich\LaravelSpatial\Tests\Custom;
66

7-
class CustomPointInvalid
8-
{
9-
}
7+
class CustomPointInvalid {}

tests/Eloquent/HasSpatialTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
});
383383

384384
it('toSpatialExpressionString can handle a Expression input', function (): void {
385-
$model = new TestPlace();
385+
$model = new TestPlace;
386386
$method = (new ReflectionClass(TestPlace::class))->getMethod('toSpatialExpressionString');
387387

388388
$result = $method->invoke($model, $model->newQuery(), DB::raw('POINT(longitude, latitude)'));
@@ -391,7 +391,7 @@
391391
});
392392

393393
it('toSpatialExpressionString can handle a Geometry input', function (): void {
394-
$model = new TestPlace();
394+
$model = new TestPlace;
395395
$method = (new ReflectionClass(TestPlace::class))->getMethod('toSpatialExpressionString');
396396
$polygon = Polygon::fromJson('{"type":"Polygon","coordinates":[[[-1,-1],[1,-1],[1,1],[-1,1],[-1,-1]]]}');
397397

@@ -404,7 +404,7 @@
404404
});
405405

406406
it('toSpatialExpressionString can handle a string input', function (): void {
407-
$model = new TestPlace();
407+
$model = new TestPlace;
408408
$method = (new ReflectionClass(TestPlace::class))->getMethod('toSpatialExpressionString');
409409

410410
$result = $method->invoke($model, $model->newQuery(), 'test_places.point');

tests/Pest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
function isSupportAxisOrder(): bool
1111
{
12-
return (new Connection())->isSupportAxisOrder(DB::connection());
12+
return (new Connection)->isSupportAxisOrder(DB::connection());
1313
}
1414

1515
/**

0 commit comments

Comments
 (0)