Skip to content

Commit

Permalink
skip doctrine on laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
MatanYadaev committed Feb 28, 2024
1 parent 8c85652 commit 22bd699
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/EloquentSpatialServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Illuminate\Database\Connection;
use Illuminate\Database\DatabaseServiceProvider;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\DB;
use MatanYadaev\EloquentSpatial\Doctrine\GeographyType;
use MatanYadaev\EloquentSpatial\Doctrine\GeometryCollectionType;
Expand All @@ -21,6 +22,10 @@ class EloquentSpatialServiceProvider extends DatabaseServiceProvider
{
public function boot(): void
{
if (version_compare(Application::VERSION, '11.0.0', '>=') || str_starts_with(Application::VERSION, '11.')) {

Check failure on line 25 in src/EloquentSpatialServiceProvider.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3)

Left side of || is always false.

Check failure on line 25 in src/EloquentSpatialServiceProvider.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Left side of || is always false.

Check failure on line 25 in src/EloquentSpatialServiceProvider.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Left side of || is always false.
return;
}

/** @var Connection $connection */
$connection = DB::connection();

Expand Down
3 changes: 2 additions & 1 deletion tests/DoctrineTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use MatanYadaev\EloquentSpatial\Doctrine\MultiPolygonType;
use MatanYadaev\EloquentSpatial\Doctrine\PointType;
use MatanYadaev\EloquentSpatial\Doctrine\PolygonType;
use Illuminate\Foundation\Application;

/** @var array{column: string, postgresType: class-string<Type>, mySqlType: class-string<Type>} $typeClass */
$dataset = [
Expand Down Expand Up @@ -62,4 +63,4 @@
$columns = $doctrineSchemaManager->listTableColumns('test_places');

expect($columns[$column]->getType())->toBeInstanceOfOnPostgres($postgresType)->toBeInstanceOfOnMysql($mySqlType);
})->with($dataset);
})->with($dataset)->skip(version_compare(Application::VERSION, '11.0.0', '>=') || str_starts_with(Application::VERSION, '11.'));

Check failure on line 66 in tests/DoctrineTypesTest.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3)

Left side of || is always false.

Check failure on line 66 in tests/DoctrineTypesTest.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Left side of || is always false.

Check failure on line 66 in tests/DoctrineTypesTest.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Left side of || is always false.

0 comments on commit 22bd699

Please sign in to comment.