Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatanYadaev committed Jul 24, 2024
1 parent f16e304 commit 4ec5a4c
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 35 deletions.
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ parameters:
-
message: '#Call to an undefined method Pest\\Expectation\<.+\>\:\:toBe(InstanceOf)?On(Postgres|Mysql)\(\)#'
path: tests/*.php
-
identifier: missingType.generics

level: max
checkMissingIterableValueType: true
checkGenericClassInNonGenericObjectType: false
4 changes: 1 addition & 3 deletions src/GeometryExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
/** @codeCoverageIgnore */
class GeometryExpression
{
public function __construct(readonly private string $expression)
{
}
public function __construct(readonly private string $expression) {}

public function normalize(ConnectionInterface $connection): string
{
Expand Down
6 changes: 3 additions & 3 deletions tests/HasSpatialTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@
});

it('toExpressionString can handle a Expression input', function (): void {
$spatialBuilder = new TestPlace();
$spatialBuilder = new TestPlace;
$toExpressionStringMethod = (new ReflectionClass($spatialBuilder))->getMethod('toExpressionString');

$result = $toExpressionStringMethod->invoke($spatialBuilder, DB::raw('POINT(longitude, latitude)'));
Expand All @@ -456,7 +456,7 @@
});

it('toExpressionString can handle a Geometry input', function (): void {
$testPlace = new TestPlace();
$testPlace = new TestPlace;
$toExpressionStringMethod = (new ReflectionClass($testPlace))->getMethod('toExpressionString');
$polygon = Polygon::fromJson('{"type":"Polygon","coordinates":[[[-1,-1],[1,-1],[1,1],[-1,1],[-1,-1]]]}');

Expand All @@ -469,7 +469,7 @@
});

it('toExpressionString can handle a string input', function (): void {
$spatialBuilder = new TestPlace();
$spatialBuilder = new TestPlace;
$toExpressionStringMethod = (new ReflectionClass($spatialBuilder))->getMethod('toExpressionString');

$result = $toExpressionStringMethod->invoke($spatialBuilder, 'test_places.point');
Expand Down
1 change: 0 additions & 1 deletion tests/Objects/GeometryCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@
it('adds a macro toGeometryCollection', function (): void {
Geometry::macro('getName', function (): string {
/** @var Geometry $this */
// @phpstan-ignore-next-line
return class_basename($this);
});

Expand Down
1 change: 0 additions & 1 deletion tests/Objects/LineStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
it('adds a macro toLineString', function (): void {
Geometry::macro('getName', function (): string {
/** @var Geometry $this */
// @phpstan-ignore-next-line
return class_basename($this);
});

Expand Down
1 change: 0 additions & 1 deletion tests/Objects/MultiLineStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@
it('adds a macro toMultiLineString', function (): void {
Geometry::macro('getName', function (): string {
/** @var Geometry $this */
// @phpstan-ignore-next-line
return class_basename($this);
});

Expand Down
1 change: 0 additions & 1 deletion tests/Objects/MultiPointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
it('adds a macro toMultiPoint', function (): void {
Geometry::macro('getName', function (): string {
/** @var Geometry $this */
// @phpstan-ignore-next-line
return class_basename($this);
});

Expand Down
1 change: 0 additions & 1 deletion tests/Objects/MultiPolygonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
it('adds a macro toMultiPolygon', function (): void {
Geometry::macro('getName', function (): string {
/** @var Geometry $this */
// @phpstan-ignore-next-line
return class_basename($this);
});

Expand Down
1 change: 0 additions & 1 deletion tests/Objects/PointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
it('adds a macro toPoint', function (): void {
Geometry::macro('getName', function (): string {
/** @var Geometry $this */
// @phpstan-ignore-next-line
return class_basename($this);
});

Expand Down
1 change: 0 additions & 1 deletion tests/Objects/PolygonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@
it('adds a macro toPolygon', function (): void {
Geometry::macro('getName', function (): string {
/** @var Geometry $this */
// @phpstan-ignore-next-line
return class_basename($this);
});

Expand Down
4 changes: 1 addition & 3 deletions tests/TestObjects/ExtendedGeometryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use MatanYadaev\EloquentSpatial\Objects\GeometryCollection;

class ExtendedGeometryCollection extends GeometryCollection
{
}
class ExtendedGeometryCollection extends GeometryCollection {}
4 changes: 1 addition & 3 deletions tests/TestObjects/ExtendedLineString.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use MatanYadaev\EloquentSpatial\Objects\LineString;

class ExtendedLineString extends LineString
{
}
class ExtendedLineString extends LineString {}
4 changes: 1 addition & 3 deletions tests/TestObjects/ExtendedMultiLineString.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use MatanYadaev\EloquentSpatial\Objects\MultiLineString;

class ExtendedMultiLineString extends MultiLineString
{
}
class ExtendedMultiLineString extends MultiLineString {}
4 changes: 1 addition & 3 deletions tests/TestObjects/ExtendedMultiPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use MatanYadaev\EloquentSpatial\Objects\MultiPoint;

class ExtendedMultiPoint extends MultiPoint
{
}
class ExtendedMultiPoint extends MultiPoint {}
4 changes: 1 addition & 3 deletions tests/TestObjects/ExtendedMultiPolygon.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use MatanYadaev\EloquentSpatial\Objects\MultiPolygon;

class ExtendedMultiPolygon extends MultiPolygon
{
}
class ExtendedMultiPolygon extends MultiPolygon {}
4 changes: 1 addition & 3 deletions tests/TestObjects/ExtendedPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use MatanYadaev\EloquentSpatial\Objects\Point;

class ExtendedPoint extends Point
{
}
class ExtendedPoint extends Point {}
4 changes: 1 addition & 3 deletions tests/TestObjects/ExtendedPolygon.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use MatanYadaev\EloquentSpatial\Objects\Polygon;

class ExtendedPolygon extends Polygon
{
}
class ExtendedPolygon extends Polygon {}

0 comments on commit 4ec5a4c

Please sign in to comment.