From c0a309b42fc260746e8a7c3039fdce03c01b3493 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 17:15:35 +0200 Subject: [PATCH 01/19] Update DBAL to a minimum of 3.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 695b85c6..b91a2fe7 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ ], "require": { "php": "^8.0", - "doctrine/dbal": "^2.13 || ^3.1" + "doctrine/dbal": "^3.2" }, "require-dev": { "doctrine/orm": "^2.9", From dba55107b64a1867d971e9b1db190abd602bb07b Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 17:19:23 +0200 Subject: [PATCH 02/19] DBAL middleware, driver, and extended platform --- src/Driver/Driver.php | 53 ++++++++++++ src/Driver/Middleware.php | 15 ++++ src/Driver/PostGISPlatform.php | 152 +++++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 src/Driver/Driver.php create mode 100644 src/Driver/Middleware.php create mode 100644 src/Driver/PostGISPlatform.php diff --git a/src/Driver/Driver.php b/src/Driver/Driver.php new file mode 100644 index 00000000..e7ba3843 --- /dev/null +++ b/src/Driver/Driver.php @@ -0,0 +1,53 @@ +decorated = $decorated; + } + + public function connect(array $params): DBAL\Driver\Connection + { + $connection = $this->decorated->connect($params); + if (!Type::hasType(PostGISType::GEOMETRY)) { + Type::addType(PostGISType::GEOMETRY, GeometryType::class); + } + + if (!Type::hasType(PostGISType::GEOGRAPHY)) { + Type::addType(PostGISType::GEOGRAPHY, GeographyType::class); + } + + return $connection; + } + + public function getDatabasePlatform(): AbstractPlatform + { + return new PostGISPlatform(); + } + + public function createDatabasePlatformForVersion($version): AbstractPlatform + { + return $this->getDatabasePlatform(); + } + + public function getExceptionConverter(): ExceptionConverter + { + return $this->decorated->getExceptionConverter(); + } +} diff --git a/src/Driver/Middleware.php b/src/Driver/Middleware.php new file mode 100644 index 00000000..59ba7076 --- /dev/null +++ b/src/Driver/Middleware.php @@ -0,0 +1,15 @@ +getDatabasePlatform(); + + return new SchemaManager($connection, $platform); + } + + public function getAlterSchemaSQL(SchemaDiff $diff): array + { + $spatialIndexes = []; + foreach ($diff->getAlteredTables() as $tableDiff) { + $table = $tableDiff->getOldTable(); + if (!$table) { + continue; + } + + /** @var Index[] $indices */ + $indices = []; + foreach (SpatialIndexes::ensureTableDiffFlag($tableDiff) as $index) { + $indices[] = $index; + } + $spatialIndexes[$table->getName()] = ['table' => $table, 'indexes' => $indices]; + + SpatialIndexes::filterTableDiff($tableDiff); + } + + $sql = parent::getAlterSchemaSQL($diff); + + $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); + foreach ($spatialIndexes as $spatialIndex) { + /** @var Table $table */ + $table = $spatialIndex['table']; + /** @var Index $index */ + foreach ($spatialIndex['indexes'] as $index) { + $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); + } + } + + return $sql; + } + + public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES): array + { + $spatialIndexes = SpatialIndexes::ensureTableFlag($table); + + foreach ($spatialIndexes as $index) { + $table->dropIndex($index->getName()); + } + + $sql = parent::getCreateTableSQL($table, $createFlags); + + $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); + foreach ($spatialIndexes as $index) { + $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); + } + + return $sql; + } + + public function getCreateTablesSQL(array $tables): array + { + $sql = []; + $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); + + /** @var Table $table */ + foreach ($tables as $table) { + $spatialIndexes = SpatialIndexes::ensureTableFlag($table); + + foreach ($spatialIndexes as $index) { + $table->dropIndex($index->getName()); + } + $sql = [...$sql, ...$this->getCreateTableWithoutForeignKeysSQL($table)]; + + foreach ($spatialIndexes as $index) { + $table->addIndex($index->getColumns(), $index->getName(), $index->getFlags(), $index->getOptions()); + } + + foreach ($spatialIndexes as $spatialIndex) { + $sql[] = $spatialIndexSqlGenerator->getSql($spatialIndex, $table); + } + } + + foreach ($tables as $table) { + foreach ($table->getForeignKeys() as $foreignKey) { + $sql[] = $this->getCreateForeignKeySQL( + $foreignKey, + $table->getQuotedName($this), + ); + } + } + + return $sql; + } + + public function getAlterTableSQL(TableDiff $diff): array + { + $table = $diff->getOldTable(); + $spatialIndexes = []; + $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); + + if ($table) { + $spatialIndexes = SpatialIndexes::ensureTableDiffFlag($diff); + } + + SpatialIndexes::filterTableDiff($diff); + + $sql = parent::getAlterTableSQL($diff); + + if (!$table) { + return $sql; + } + + foreach ($spatialIndexes as $spatialIndex) { + $sql[] = $spatialIndexSqlGenerator->getSql($spatialIndex, $table); + } + + /** @var ColumnDiff $columnDiff */ + foreach ($diff->getModifiedColumns() as $columnDiff) { + if ($columnDiff->hasChanged('srid')) { + $sql[] = sprintf( + "SELECT UpdateGeometrySRID('%s', '%s', %d)", + $table->getName(), + $columnDiff->getNewColumn()->getName(), + (int) $columnDiff->getNewColumn()->getPlatformOption('srid') + ); + } + } + + return $sql; + } +} From 69f1e8f555c19d83d3cc6570216b386ee2cd1221 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 17:20:46 +0200 Subject: [PATCH 03/19] Migrate SchemaManager to extend DBAL's --- src/Schema/SchemaManager.php | 123 ++++++++++++++++++++++++++-- src/Schema/SchemaManagerFactory.php | 20 +++++ src/Schema/SpatialIndexes.php | 87 ++++++++++++++++++++ 3 files changed, 221 insertions(+), 9 deletions(-) create mode 100644 src/Schema/SchemaManagerFactory.php create mode 100644 src/Schema/SpatialIndexes.php diff --git a/src/Schema/SchemaManager.php b/src/Schema/SchemaManager.php index 18570c0d..0369a18c 100644 --- a/src/Schema/SchemaManager.php +++ b/src/Schema/SchemaManager.php @@ -4,15 +4,68 @@ namespace Jsor\Doctrine\PostGIS\Schema; -use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Schema\Column; +use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; +use Doctrine\DBAL\Schema\Table; +use Doctrine\DBAL\Schema\TableDiff; +use Jsor\Doctrine\PostGIS\Types\GeographyType; +use Jsor\Doctrine\PostGIS\Types\GeometryType; +use Jsor\Doctrine\PostGIS\Types\PostGISType; +use RuntimeException; -final class SchemaManager +final class SchemaManager extends PostgreSQLSchemaManager { - private Connection $connection; + public function alterTable(TableDiff $tableDiff): void + { + $oldTable = $tableDiff->getOldTable(); + if (!$oldTable) { + return; + } + + foreach ($tableDiff->getModifiedColumns() as $columnDiff) { + if (!$columnDiff->getNewColumn()->getType() instanceof PostGISType) { + continue; + } + + $newColumn = $columnDiff->getNewColumn(); + $oldColumn = $columnDiff->getOldColumn(); + + if ($columnDiff->hasTypeChanged()) { + throw new RuntimeException('The type of a spatial column cannot be changed (Requested changing type from "' . ($oldColumn?->getType()?->getName() ?? 'N/A') . '" to "' . $newColumn->getType()->getName() . '" for column "' . $newColumn->getName() . '" in table "' . $oldTable->getName() . '")'); + } + + if ($columnDiff->hasChanged('geometry_type')) { + throw new RuntimeException('The geometry_type of a spatial column cannot be changed (Requested changing type from "' . strtoupper((string) ($oldColumn?->getPlatformOption('geometry_type') ?? 'N/A')) . '" to "' . strtoupper((string) $newColumn->getPlatformOption('geometry_type')) . '" for column "' . $newColumn->getName() . '" in table "' . $oldTable->getName() . '")'); + } + } + + parent::alterTable($tableDiff); + } + + public function introspectTable(string $name): Table + { + $table = parent::introspectTable($name); + + SpatialIndexes::ensureTableFlag($table); + + return $table; + } - public function __construct(Connection $connection) + public function listTableIndexes($table): array { - $this->connection = $connection; + $indexes = parent::listTableIndexes($table); + $columns = $this->listTableColumns($table); + + foreach ($indexes as $index) { + foreach ($index->getColumns() as $columnName) { + $column = $columns[$columnName]; + if ($column->getType() instanceof PostGISType && !$index->hasFlag('spatial')) { + $index->addFlag('spatial'); + } + } + } + + return $indexes; } public function listSpatialIndexes(string $table): array @@ -32,7 +85,7 @@ public function listSpatialIndexes(string $table): array ORDER BY i.relname"; /** @var array $tableIndexes */ - $tableIndexes = $this->connection->fetchAllAssociative( + $tableIndexes = $this->_conn->fetchAllAssociative( $sql, [ $this->trimQuotes($table), @@ -51,7 +104,7 @@ public function listSpatialIndexes(string $table): array AND a.attnum IN (" . implode(',', explode(' ', $row['indkey'])) . ') AND a.atttypid = t.oid'; - $stmt = $this->connection->executeQuery($sql); + $stmt = $this->_conn->executeQuery($sql); /** @var array $indexColumns */ $indexColumns = $stmt->fetchAllAssociative(); @@ -85,7 +138,7 @@ public function getGeometrySpatialColumnInfo(string $table, string $column): ?ar AND f_geometry_column = ?'; /** @var array{coord_dimension: string, srid: string|int|null, type: string}|null $row */ - $row = $this->connection->fetchAssociative( + $row = $this->_conn->fetchAssociative( $sql, [ $this->trimQuotes($table), @@ -112,7 +165,7 @@ public function getGeographySpatialColumnInfo(string $table, string $column): ?a AND f_geography_column = ?'; /** @var array{coord_dimension: string, srid: string|int|null, type: string}|null $row */ - $row = $this->connection->fetchAssociative( + $row = $this->_conn->fetchAssociative( $sql, [ $this->trimQuotes($table), @@ -127,6 +180,58 @@ public function getGeographySpatialColumnInfo(string $table, string $column): ?a return $this->buildSpatialColumnInfo($row); } + protected function _getPortableTableColumnList($table, $database, $tableColumns): array + { + $columns = parent::_getPortableTableColumnList($table, $database, $tableColumns); + + foreach ($columns as $column) { + $this->resolveSpatialColumnInfo($column, $table); + } + + return $columns; + } + + protected function _getPortableTableColumnDefinition($tableColumn): Column + { + $column = parent::_getPortableTableColumnDefinition($tableColumn); + + if ($tableColumn['table_name'] ?? false) { + $this->resolveSpatialColumnInfo($column, (string) $tableColumn['table_name']); + } + + return $column; + } + + protected function resolveSpatialColumnInfo(Column $column, string $tableName): void + { + if (!$column->getType() instanceof PostGISType) { + return; + } + + $info = match ($column->getType()::class) { + GeometryType::class => $this->getGeometrySpatialColumnInfo($tableName, $column->getName()), + GeographyType::class => $this->getGeographySpatialColumnInfo($tableName, $column->getName()), + default => null, + }; + + if (!$info) { + return; + } + + $default = null; + + if ('NULL::geometry' !== $column->getDefault() && 'NULL::geography' !== $column->getDefault()) { + $default = $column->getDefault(); + } + + $column + ->setType(PostGISType::getType($column->getType()->getName())) + ->setDefault($default) + ->setPlatformOption('geometry_type', $info['type']) + ->setPlatformOption('srid', $info['srid']) + ; + } + /** * @param array{coord_dimension: string, srid: string|int|null, type: string} $row */ diff --git a/src/Schema/SchemaManagerFactory.php b/src/Schema/SchemaManagerFactory.php new file mode 100644 index 00000000..0d57d76a --- /dev/null +++ b/src/Schema/SchemaManagerFactory.php @@ -0,0 +1,20 @@ +getDatabasePlatform(); + + return new SchemaManager($connection, $platform); + } +} diff --git a/src/Schema/SpatialIndexes.php b/src/Schema/SpatialIndexes.php new file mode 100644 index 00000000..0d998d38 --- /dev/null +++ b/src/Schema/SpatialIndexes.php @@ -0,0 +1,87 @@ +addedIndexes = array_filter($tableDiff->addedIndexes, static fn (Index $idx) => !$idx->hasFlag('spatial')); + + $changedIndexes = []; + /** @var Index $index */ + foreach ($tableDiff->changedIndexes as $index) { + if ($index->hasFlag('spatial')) { + $tableDiff->removedIndexes[] = $index; + } else { + $changedIndexes[] = $index; + } + } + $tableDiff->changedIndexes = $changedIndexes; + } + + /** + * Ensure the 'spatial' flag is set on PostGIS columns in a Table. + * + * @return Index[] the spacial indicies + */ + public static function ensureTableFlag(Table $table): array + { + return static::ensureFlag($table, $table->getIndexes()); + } + + /** + * Ensure the 'spatial' flag is set on PostGIS columns in a TableDiff. + * + * @return Index[] the spacial indicies + */ + public static function ensureTableDiffFlag(TableDiff $tableDiff): array + { + $table = $tableDiff->getOldTable(); + if (!$table) { + return []; + } + + $addedSpatialIndexes = static::ensureFlag($table, $tableDiff->getAddedIndexes()); + + $modifiedSpatialIndexes = static::ensureFlag($table, $tableDiff->getModifiedIndexes()); + + return array_merge($addedSpatialIndexes, $modifiedSpatialIndexes); + } + + /** @return Index[] */ + private static function ensureFlag(Table $table, array $indexes): array + { + $spatialIndexes = []; + + /** @var Index $index */ + foreach ($indexes as $index) { + foreach ($index->getColumns() as $columnName) { + if (!$table->hasColumn($columnName)) { + continue; + } + + $column = $table->getColumn($columnName); + if ($column->getType() instanceof PostGISType) { + if (!$index->hasFlag('spatial')) { + $index->addFlag('spatial'); + } + + $spatialIndexes[$index->getName()] = $index; + } + } + } + + return array_values($spatialIndexes); + } +} From 95bebb4e396927add9147c2fa09c588a1658b90d Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 17:21:40 +0200 Subject: [PATCH 04/19] Remove DBAL event subscriber & change ORM to listener --- src/Event/DBALSchemaEventSubscriber.php | 238 ------------------ ...scriber.php => ORMSchemaEventListener.php} | 13 +- 2 files changed, 1 insertion(+), 250 deletions(-) delete mode 100644 src/Event/DBALSchemaEventSubscriber.php rename src/Event/{ORMSchemaEventSubscriber.php => ORMSchemaEventListener.php} (72%) diff --git a/src/Event/DBALSchemaEventSubscriber.php b/src/Event/DBALSchemaEventSubscriber.php deleted file mode 100644 index b686470f..00000000 --- a/src/Event/DBALSchemaEventSubscriber.php +++ /dev/null @@ -1,238 +0,0 @@ -getTable(); - - $spatialIndexes = []; - - foreach ($table->getIndexes() as $index) { - if (!$index->hasFlag('spatial')) { - continue; - } - - $spatialIndexes[] = $index; - $table->dropIndex($index->getName()); - } - - if (0 === count($spatialIndexes)) { - return; - } - - // Avoid this listener from creating a loop on this table when calling - // $platform->getCreateTableSQL() later - if ($table->hasOption(self::PROCESSING_TABLE_FLAG)) { - return; - } - - $table->addOption(self::PROCESSING_TABLE_FLAG, true); - - $platform = $args->getPlatform(); - - foreach ($platform->getCreateTableSQL($table) as $sql) { - $args->addSql($sql); - } - - $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($platform); - - foreach ($spatialIndexes as $index) { - $args->addSql($spatialIndexSqlGenerator->getSql($index, $table)); - } - - $args->preventDefault(); - } - - public function onSchemaAlterTable(SchemaAlterTableEventArgs $args): void - { - $platform = $args->getPlatform(); - $diff = $args->getTableDiff(); - - $spatialIndexes = []; - $addedIndexes = []; - $changedIndexes = []; - - foreach ($diff->addedIndexes as $index) { - if (!$index->hasFlag('spatial')) { - $addedIndexes[] = $index; - } else { - $spatialIndexes[] = $index; - } - } - - foreach ($diff->changedIndexes as $index) { - if (!$index->hasFlag('spatial')) { - $changedIndexes[] = $index; - } else { - $diff->removedIndexes[] = $index; - $spatialIndexes[] = $index; - } - } - - $diff->addedIndexes = $addedIndexes; - $diff->changedIndexes = $changedIndexes; - - $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($platform); - - $table = new Identifier(false !== $diff->newName ? $diff->newName : $diff->name); - - foreach ($spatialIndexes as $index) { - $args - ->addSql( - $spatialIndexSqlGenerator->getSql($index, $table) - ) - ; - } - } - - public function onSchemaAlterTableChangeColumn(SchemaAlterTableChangeColumnEventArgs $args): void - { - $columnDiff = $args->getColumnDiff(); - $column = $columnDiff->column; - - if (!$column->getType() instanceof PostGISType) { - return; - } - - $diff = $args->getTableDiff(); - $table = new Identifier(false !== $diff->newName ? $diff->newName : $diff->name); - - if ($columnDiff->hasChanged('type')) { - throw new RuntimeException('The type of a spatial column cannot be changed (Requested changing type from "' . ($columnDiff->fromColumn?->getType()?->getName() ?? 'N/A') . '" to "' . $column->getType()->getName() . '" for column "' . $column->getName() . '" in table "' . $table->getName() . '")'); - } - - if ($columnDiff->hasChanged('geometry_type')) { - throw new RuntimeException('The geometry_type of a spatial column cannot be changed (Requested changing type from "' . strtoupper((string) ($columnDiff->fromColumn?->getPlatformOption('geometry_type') ?? 'N/A')) . '" to "' . strtoupper((string) $column->getPlatformOption('geometry_type')) . '" for column "' . $column->getName() . '" in table "' . $table->getName() . '")'); - } - - if ($columnDiff->hasChanged('srid')) { - $args->addSql(sprintf( - "SELECT UpdateGeometrySRID('%s', '%s', %d)", - $table->getName(), - $column->getName(), - (int) $column->getPlatformOption('srid') - )); - } - } - - public function onSchemaColumnDefinition(SchemaColumnDefinitionEventArgs $args): void - { - /** @var array{type: string, default: string, field: string, isnotnull: int|bool, comment: string|null} $tableColumn */ - $tableColumn = array_change_key_case($args->getTableColumn(), CASE_LOWER); - $table = $args->getTable(); - - $schemaManager = new SchemaManager($args->getConnection()); - $info = null; - - if ('geometry' === $tableColumn['type']) { - $info = $schemaManager->getGeometrySpatialColumnInfo($table, $tableColumn['field']); - } elseif ('geography' === $tableColumn['type']) { - $info = $schemaManager->getGeographySpatialColumnInfo($table, $tableColumn['field']); - } - - if (null === $info) { - return; - } - - $default = null; - - if (isset($tableColumn['default']) - && 'NULL::geometry' !== $tableColumn['default'] - && 'NULL::geography' !== $tableColumn['default']) { - $default = $tableColumn['default']; - } - - $options = [ - 'notnull' => (bool) $tableColumn['isnotnull'], - 'default' => $default, - 'comment' => $tableColumn['comment'] ?? null, - ]; - - $column = new Column($tableColumn['field'], PostGISType::getType($tableColumn['type']), $options); - - $column - ->setPlatformOption('geometry_type', $info['type']) - ->setPlatformOption('srid', $info['srid']) - ; - - $args - ->setColumn($column) - ->preventDefault(); - } - - public function onSchemaIndexDefinition(SchemaIndexDefinitionEventArgs $args): void - { - /** @var array{name: string, columns: array, unique: bool, primary: bool, flags: array} $index */ - $index = $args->getTableIndex(); - - $schemaManager = new SchemaManager($args->getConnection()); - $spatialIndexes = $schemaManager->listSpatialIndexes($args->getTable()); - - if (!isset($spatialIndexes[$index['name']])) { - return; - } - - $spatialIndex = new Index( - $index['name'], - $index['columns'], - $index['unique'], - $index['primary'], - array_merge($index['flags'], ['spatial']) - ); - - $args - ->setIndex($spatialIndex) - ->preventDefault() - ; - } -} diff --git a/src/Event/ORMSchemaEventSubscriber.php b/src/Event/ORMSchemaEventListener.php similarity index 72% rename from src/Event/ORMSchemaEventSubscriber.php rename to src/Event/ORMSchemaEventListener.php index fb51a38f..308031d1 100644 --- a/src/Event/ORMSchemaEventSubscriber.php +++ b/src/Event/ORMSchemaEventListener.php @@ -5,21 +5,10 @@ namespace Jsor\Doctrine\PostGIS\Event; use Doctrine\ORM\Tools\Event\GenerateSchemaTableEventArgs; -use Doctrine\ORM\Tools\ToolEvents; use Jsor\Doctrine\PostGIS\Types\PostGISType; -class ORMSchemaEventSubscriber extends DBALSchemaEventSubscriber +class ORMSchemaEventListener { - public function getSubscribedEvents(): array - { - return array_merge( - parent::getSubscribedEvents(), - [ - ToolEvents::postGenerateSchemaTable, - ] - ); - } - public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $args): void { $table = $args->getClassTable(); From cd6e7467b023a6eced98e63fefab134b924fd27f Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 17:22:30 +0200 Subject: [PATCH 05/19] Add @covers to generated Functions --- tests/Functions/GeographyTest.php | 2 ++ tests/Functions/GeometryTest.php | 2 ++ tests/Functions/GeometryTypeTest.php | 2 ++ tests/Functions/ST_3DClosestPointTest.php | 2 ++ tests/Functions/ST_3DDFullyWithinTest.php | 2 ++ tests/Functions/ST_3DDWithinTest.php | 2 ++ tests/Functions/ST_3DDistanceTest.php | 2 ++ tests/Functions/ST_3DIntersectsTest.php | 2 ++ tests/Functions/ST_3DLengthTest.php | 2 ++ tests/Functions/ST_3DLongestLineTest.php | 2 ++ tests/Functions/ST_3DMakeBoxTest.php | 2 ++ tests/Functions/ST_3DMaxDistanceTest.php | 2 ++ tests/Functions/ST_3DShortestLineTest.php | 2 ++ tests/Functions/ST_AddPointTest.php | 2 ++ tests/Functions/ST_AreaTest.php | 2 ++ tests/Functions/ST_AsBinaryTest.php | 2 ++ tests/Functions/ST_AsEWKBTest.php | 2 ++ tests/Functions/ST_AsEWKTTest.php | 2 ++ tests/Functions/ST_AsGMLTest.php | 2 ++ tests/Functions/ST_AsGeoJSONTest.php | 2 ++ tests/Functions/ST_AsHEXEWKBTest.php | 2 ++ tests/Functions/ST_AsLatLonTextTest.php | 2 ++ tests/Functions/ST_AsSVGTest.php | 2 ++ tests/Functions/ST_AsTextTest.php | 2 ++ tests/Functions/ST_AzimuthTest.php | 2 ++ tests/Functions/ST_BoundaryTest.php | 2 ++ tests/Functions/ST_Box2dFromGeoHashTest.php | 2 ++ tests/Functions/ST_BufferTest.php | 2 ++ tests/Functions/ST_CentroidTest.php | 2 ++ tests/Functions/ST_ClosestPointTest.php | 2 ++ tests/Functions/ST_CollectTest.php | 2 ++ tests/Functions/ST_ContainsProperlyTest.php | 2 ++ tests/Functions/ST_ContainsTest.php | 2 ++ tests/Functions/ST_CoordDimTest.php | 2 ++ tests/Functions/ST_CoveredByTest.php | 2 ++ tests/Functions/ST_CoversTest.php | 2 ++ tests/Functions/ST_CrossesTest.php | 2 ++ tests/Functions/ST_DFullyWithinTest.php | 2 ++ tests/Functions/ST_DWithinTest.php | 2 ++ tests/Functions/ST_DifferenceTest.php | 2 ++ tests/Functions/ST_DimensionTest.php | 2 ++ tests/Functions/ST_DisjointTest.php | 2 ++ tests/Functions/ST_DistanceSphereTest.php | 2 ++ tests/Functions/ST_DistanceSpheroidTest.php | 2 ++ tests/Functions/ST_DistanceTest.php | 2 ++ tests/Functions/ST_EndPointTest.php | 2 ++ tests/Functions/ST_EnvelopeTest.php | 2 ++ tests/Functions/ST_EqualsTest.php | 2 ++ tests/Functions/ST_ExtentTest.php | 2 ++ tests/Functions/ST_ExteriorRingTest.php | 2 ++ tests/Functions/ST_FlipCoordinatesTest.php | 2 ++ tests/Functions/ST_GeoHashTest.php | 2 ++ tests/Functions/ST_GeogFromTextTest.php | 2 ++ tests/Functions/ST_GeogFromWKBTest.php | 2 ++ tests/Functions/ST_GeographyFromTextTest.php | 2 ++ tests/Functions/ST_GeomCollFromTextTest.php | 2 ++ tests/Functions/ST_GeomFromEWKBTest.php | 2 ++ tests/Functions/ST_GeomFromEWKTTest.php | 2 ++ tests/Functions/ST_GeomFromGMLTest.php | 2 ++ tests/Functions/ST_GeomFromGeoHashTest.php | 2 ++ tests/Functions/ST_GeomFromGeoJSONTest.php | 2 ++ tests/Functions/ST_GeomFromKMLTest.php | 2 ++ tests/Functions/ST_GeomFromTextTest.php | 2 ++ tests/Functions/ST_GeomFromWKBTest.php | 2 ++ tests/Functions/ST_GeometryFromTextTest.php | 2 ++ tests/Functions/ST_GeometryNTest.php | 2 ++ tests/Functions/ST_GeometryTypeTest.php | 2 ++ tests/Functions/ST_HasArcTest.php | 2 ++ tests/Functions/ST_HausdorffDistanceTest.php | 2 ++ tests/Functions/ST_InteriorRingNTest.php | 2 ++ tests/Functions/ST_IntersectionTest.php | 2 ++ tests/Functions/ST_IntersectsTest.php | 2 ++ tests/Functions/ST_IsClosedTest.php | 2 ++ tests/Functions/ST_IsCollectionTest.php | 2 ++ tests/Functions/ST_IsEmptyTest.php | 2 ++ tests/Functions/ST_IsRingTest.php | 2 ++ tests/Functions/ST_IsSimpleTest.php | 2 ++ tests/Functions/ST_IsValidDetailTest.php | 2 ++ tests/Functions/ST_IsValidReasonTest.php | 2 ++ tests/Functions/ST_IsValidTest.php | 2 ++ tests/Functions/ST_LengthSpheroidTest.php | 2 ++ tests/Functions/ST_LengthTest.php | 2 ++ tests/Functions/ST_LineCrossingDirectionTest.php | 2 ++ tests/Functions/ST_LineFromMultiPointTest.php | 2 ++ tests/Functions/ST_LineFromTextTest.php | 2 ++ tests/Functions/ST_LineFromWKBTest.php | 2 ++ tests/Functions/ST_LinestringFromWKBTest.php | 2 ++ tests/Functions/ST_LongestLineTest.php | 2 ++ tests/Functions/ST_MLineFromTextTest.php | 2 ++ tests/Functions/ST_MPointFromTextTest.php | 2 ++ tests/Functions/ST_MPolyFromTextTest.php | 2 ++ tests/Functions/ST_MTest.php | 2 ++ tests/Functions/ST_MakeBox2DTest.php | 2 ++ tests/Functions/ST_MakeEnvelopeTest.php | 2 ++ tests/Functions/ST_MakeLineTest.php | 2 ++ tests/Functions/ST_MakePointMTest.php | 2 ++ tests/Functions/ST_MakePointTest.php | 2 ++ tests/Functions/ST_MakePolygonTest.php | 2 ++ tests/Functions/ST_MaxDistanceTest.php | 2 ++ tests/Functions/ST_MinimumBoundingCircleTest.php | 2 ++ tests/Functions/ST_MultiTest.php | 2 ++ tests/Functions/ST_NDimsTest.php | 2 ++ tests/Functions/ST_NPointsTest.php | 2 ++ tests/Functions/ST_NRingsTest.php | 2 ++ tests/Functions/ST_NumGeometriesTest.php | 2 ++ tests/Functions/ST_NumInteriorRingTest.php | 2 ++ tests/Functions/ST_NumInteriorRingsTest.php | 2 ++ tests/Functions/ST_NumPatchesTest.php | 2 ++ tests/Functions/ST_NumPointsTest.php | 2 ++ tests/Functions/ST_OrderingEqualsTest.php | 2 ++ tests/Functions/ST_OverlapsTest.php | 2 ++ tests/Functions/ST_PatchNTest.php | 2 ++ tests/Functions/ST_PerimeterTest.php | 2 ++ tests/Functions/ST_PointFromGeoHashTest.php | 2 ++ tests/Functions/ST_PointFromTextTest.php | 2 ++ tests/Functions/ST_PointFromWKBTest.php | 2 ++ tests/Functions/ST_PointNTest.php | 2 ++ tests/Functions/ST_PointOnSurfaceTest.php | 2 ++ tests/Functions/ST_PointTest.php | 2 ++ tests/Functions/ST_PolygonFromTextTest.php | 2 ++ tests/Functions/ST_PolygonTest.php | 2 ++ tests/Functions/ST_ProjectTest.php | 2 ++ tests/Functions/ST_RelateTest.php | 2 ++ tests/Functions/ST_SRIDTest.php | 2 ++ tests/Functions/ST_ScaleTest.php | 2 ++ tests/Functions/ST_SetSRIDTest.php | 2 ++ tests/Functions/ST_ShiftLongitudeTest.php | 2 ++ tests/Functions/ST_ShortestLineTest.php | 2 ++ tests/Functions/ST_SnapToGridTest.php | 2 ++ tests/Functions/ST_SplitTest.php | 2 ++ tests/Functions/ST_StartPointTest.php | 2 ++ tests/Functions/ST_SummaryTest.php | 2 ++ tests/Functions/ST_SymDifferenceTest.php | 2 ++ tests/Functions/ST_TouchesTest.php | 2 ++ tests/Functions/ST_TransScaleTest.php | 2 ++ tests/Functions/ST_TransformTest.php | 2 ++ tests/Functions/ST_TranslateTest.php | 2 ++ tests/Functions/ST_UnionTest.php | 2 ++ tests/Functions/ST_WithinTest.php | 2 ++ tests/Functions/ST_XMaxTest.php | 2 ++ tests/Functions/ST_XMinTest.php | 2 ++ tests/Functions/ST_XTest.php | 2 ++ tests/Functions/ST_YMaxTest.php | 2 ++ tests/Functions/ST_YMinTest.php | 2 ++ tests/Functions/ST_YTest.php | 2 ++ tests/Functions/ST_ZMaxTest.php | 2 ++ tests/Functions/ST_ZMinTest.php | 2 ++ tests/Functions/ST_ZTest.php | 2 ++ tests/Functions/ST_ZmflagTest.php | 2 ++ tools/generate-functions.php | 2 ++ 150 files changed, 300 insertions(+) diff --git a/tests/Functions/GeographyTest.php b/tests/Functions/GeographyTest.php index 7cb5f7b5..9e25e948 100644 --- a/tests/Functions/GeographyTest.php +++ b/tests/Functions/GeographyTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\Geography + * * @group orm * @group functions */ diff --git a/tests/Functions/GeometryTest.php b/tests/Functions/GeometryTest.php index 7928a33a..daeb7381 100644 --- a/tests/Functions/GeometryTest.php +++ b/tests/Functions/GeometryTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\Geometry + * * @group orm * @group functions */ diff --git a/tests/Functions/GeometryTypeTest.php b/tests/Functions/GeometryTypeTest.php index e7dde937..059edfeb 100644 --- a/tests/Functions/GeometryTypeTest.php +++ b/tests/Functions/GeometryTypeTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\GeometryType + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DClosestPointTest.php b/tests/Functions/ST_3DClosestPointTest.php index 2f8002f8..fc0772b5 100644 --- a/tests/Functions/ST_3DClosestPointTest.php +++ b/tests/Functions/ST_3DClosestPointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DClosestPoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DDFullyWithinTest.php b/tests/Functions/ST_3DDFullyWithinTest.php index a730bff7..b8d4616e 100644 --- a/tests/Functions/ST_3DDFullyWithinTest.php +++ b/tests/Functions/ST_3DDFullyWithinTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DDFullyWithin + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DDWithinTest.php b/tests/Functions/ST_3DDWithinTest.php index c549025e..97e676c5 100644 --- a/tests/Functions/ST_3DDWithinTest.php +++ b/tests/Functions/ST_3DDWithinTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DDWithin + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DDistanceTest.php b/tests/Functions/ST_3DDistanceTest.php index a39a158a..2c62771a 100644 --- a/tests/Functions/ST_3DDistanceTest.php +++ b/tests/Functions/ST_3DDistanceTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DDistance + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DIntersectsTest.php b/tests/Functions/ST_3DIntersectsTest.php index f13217f1..72e87213 100644 --- a/tests/Functions/ST_3DIntersectsTest.php +++ b/tests/Functions/ST_3DIntersectsTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DIntersects + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DLengthTest.php b/tests/Functions/ST_3DLengthTest.php index e327f9a1..9617fed8 100644 --- a/tests/Functions/ST_3DLengthTest.php +++ b/tests/Functions/ST_3DLengthTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DLength + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DLongestLineTest.php b/tests/Functions/ST_3DLongestLineTest.php index de05c4ed..7fd4cdfd 100644 --- a/tests/Functions/ST_3DLongestLineTest.php +++ b/tests/Functions/ST_3DLongestLineTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DLongestLine + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DMakeBoxTest.php b/tests/Functions/ST_3DMakeBoxTest.php index cd645ef8..3d4aeeb3 100644 --- a/tests/Functions/ST_3DMakeBoxTest.php +++ b/tests/Functions/ST_3DMakeBoxTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DMakeBox + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DMaxDistanceTest.php b/tests/Functions/ST_3DMaxDistanceTest.php index 7dd9b571..6c99f26c 100644 --- a/tests/Functions/ST_3DMaxDistanceTest.php +++ b/tests/Functions/ST_3DMaxDistanceTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DMaxDistance + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_3DShortestLineTest.php b/tests/Functions/ST_3DShortestLineTest.php index 414374ed..485f6757 100644 --- a/tests/Functions/ST_3DShortestLineTest.php +++ b/tests/Functions/ST_3DShortestLineTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_3DShortestLine + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AddPointTest.php b/tests/Functions/ST_AddPointTest.php index 5891302d..4f23ed18 100644 --- a/tests/Functions/ST_AddPointTest.php +++ b/tests/Functions/ST_AddPointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AddPoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AreaTest.php b/tests/Functions/ST_AreaTest.php index a81f5131..4188cd45 100644 --- a/tests/Functions/ST_AreaTest.php +++ b/tests/Functions/ST_AreaTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Area + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsBinaryTest.php b/tests/Functions/ST_AsBinaryTest.php index d16bb51c..d652ac6d 100644 --- a/tests/Functions/ST_AsBinaryTest.php +++ b/tests/Functions/ST_AsBinaryTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsBinary + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsEWKBTest.php b/tests/Functions/ST_AsEWKBTest.php index 1b9a1de3..418d3fd4 100644 --- a/tests/Functions/ST_AsEWKBTest.php +++ b/tests/Functions/ST_AsEWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsEWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsEWKTTest.php b/tests/Functions/ST_AsEWKTTest.php index 497301a8..0de29e38 100644 --- a/tests/Functions/ST_AsEWKTTest.php +++ b/tests/Functions/ST_AsEWKTTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsEWKT + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsGMLTest.php b/tests/Functions/ST_AsGMLTest.php index 764d01ab..d70de461 100644 --- a/tests/Functions/ST_AsGMLTest.php +++ b/tests/Functions/ST_AsGMLTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsGML + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsGeoJSONTest.php b/tests/Functions/ST_AsGeoJSONTest.php index b6d3011e..800bbb92 100644 --- a/tests/Functions/ST_AsGeoJSONTest.php +++ b/tests/Functions/ST_AsGeoJSONTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsGeoJSON + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsHEXEWKBTest.php b/tests/Functions/ST_AsHEXEWKBTest.php index ea9343dc..f3dd7cbf 100644 --- a/tests/Functions/ST_AsHEXEWKBTest.php +++ b/tests/Functions/ST_AsHEXEWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsHEXEWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsLatLonTextTest.php b/tests/Functions/ST_AsLatLonTextTest.php index 5c27172a..435ef1d1 100644 --- a/tests/Functions/ST_AsLatLonTextTest.php +++ b/tests/Functions/ST_AsLatLonTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsLatLonText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsSVGTest.php b/tests/Functions/ST_AsSVGTest.php index 317dbd93..3ad1345c 100644 --- a/tests/Functions/ST_AsSVGTest.php +++ b/tests/Functions/ST_AsSVGTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsSVG + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AsTextTest.php b/tests/Functions/ST_AsTextTest.php index 97dc7c56..3209dd10 100644 --- a/tests/Functions/ST_AsTextTest.php +++ b/tests/Functions/ST_AsTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_AsText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_AzimuthTest.php b/tests/Functions/ST_AzimuthTest.php index 09c7abf6..2e1c595a 100644 --- a/tests/Functions/ST_AzimuthTest.php +++ b/tests/Functions/ST_AzimuthTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Azimuth + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_BoundaryTest.php b/tests/Functions/ST_BoundaryTest.php index ab870f32..8bbe6f47 100644 --- a/tests/Functions/ST_BoundaryTest.php +++ b/tests/Functions/ST_BoundaryTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Boundary + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_Box2dFromGeoHashTest.php b/tests/Functions/ST_Box2dFromGeoHashTest.php index 86fd7948..c254c6cd 100644 --- a/tests/Functions/ST_Box2dFromGeoHashTest.php +++ b/tests/Functions/ST_Box2dFromGeoHashTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Box2dFromGeoHash + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_BufferTest.php b/tests/Functions/ST_BufferTest.php index aa82ab71..3bd29239 100644 --- a/tests/Functions/ST_BufferTest.php +++ b/tests/Functions/ST_BufferTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Buffer + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_CentroidTest.php b/tests/Functions/ST_CentroidTest.php index ea5b274c..2460d5ca 100644 --- a/tests/Functions/ST_CentroidTest.php +++ b/tests/Functions/ST_CentroidTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Centroid + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ClosestPointTest.php b/tests/Functions/ST_ClosestPointTest.php index 1d7d05cc..e77bb6a0 100644 --- a/tests/Functions/ST_ClosestPointTest.php +++ b/tests/Functions/ST_ClosestPointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_ClosestPoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_CollectTest.php b/tests/Functions/ST_CollectTest.php index b5689b7a..5d437931 100644 --- a/tests/Functions/ST_CollectTest.php +++ b/tests/Functions/ST_CollectTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Collect + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ContainsProperlyTest.php b/tests/Functions/ST_ContainsProperlyTest.php index b12f96d0..edc1a99e 100644 --- a/tests/Functions/ST_ContainsProperlyTest.php +++ b/tests/Functions/ST_ContainsProperlyTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_ContainsProperly + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ContainsTest.php b/tests/Functions/ST_ContainsTest.php index d0170269..b3669c73 100644 --- a/tests/Functions/ST_ContainsTest.php +++ b/tests/Functions/ST_ContainsTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Contains + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_CoordDimTest.php b/tests/Functions/ST_CoordDimTest.php index 369232ab..aff951d8 100644 --- a/tests/Functions/ST_CoordDimTest.php +++ b/tests/Functions/ST_CoordDimTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_CoordDim + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_CoveredByTest.php b/tests/Functions/ST_CoveredByTest.php index c30d8dd6..7f9c756b 100644 --- a/tests/Functions/ST_CoveredByTest.php +++ b/tests/Functions/ST_CoveredByTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_CoveredBy + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_CoversTest.php b/tests/Functions/ST_CoversTest.php index bf38da82..667ba091 100644 --- a/tests/Functions/ST_CoversTest.php +++ b/tests/Functions/ST_CoversTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Covers + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_CrossesTest.php b/tests/Functions/ST_CrossesTest.php index 33648034..e39f94f2 100644 --- a/tests/Functions/ST_CrossesTest.php +++ b/tests/Functions/ST_CrossesTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Crosses + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DFullyWithinTest.php b/tests/Functions/ST_DFullyWithinTest.php index ad3007d5..7b3fe009 100644 --- a/tests/Functions/ST_DFullyWithinTest.php +++ b/tests/Functions/ST_DFullyWithinTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_DFullyWithin + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DWithinTest.php b/tests/Functions/ST_DWithinTest.php index 1033673e..667e6a7c 100644 --- a/tests/Functions/ST_DWithinTest.php +++ b/tests/Functions/ST_DWithinTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_DWithin + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DifferenceTest.php b/tests/Functions/ST_DifferenceTest.php index 74806604..bad3e470 100644 --- a/tests/Functions/ST_DifferenceTest.php +++ b/tests/Functions/ST_DifferenceTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Difference + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DimensionTest.php b/tests/Functions/ST_DimensionTest.php index 003a2d4f..dc0c99db 100644 --- a/tests/Functions/ST_DimensionTest.php +++ b/tests/Functions/ST_DimensionTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Dimension + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DisjointTest.php b/tests/Functions/ST_DisjointTest.php index 6ea419d4..bee6eaa0 100644 --- a/tests/Functions/ST_DisjointTest.php +++ b/tests/Functions/ST_DisjointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Disjoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DistanceSphereTest.php b/tests/Functions/ST_DistanceSphereTest.php index 9011ac47..31f4ae64 100644 --- a/tests/Functions/ST_DistanceSphereTest.php +++ b/tests/Functions/ST_DistanceSphereTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_DistanceSphere + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DistanceSpheroidTest.php b/tests/Functions/ST_DistanceSpheroidTest.php index 50083ad5..b1f06c67 100644 --- a/tests/Functions/ST_DistanceSpheroidTest.php +++ b/tests/Functions/ST_DistanceSpheroidTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_DistanceSpheroid + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_DistanceTest.php b/tests/Functions/ST_DistanceTest.php index 4c6c7416..b93b0e1a 100644 --- a/tests/Functions/ST_DistanceTest.php +++ b/tests/Functions/ST_DistanceTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Distance + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_EndPointTest.php b/tests/Functions/ST_EndPointTest.php index 604800a8..d0b08332 100644 --- a/tests/Functions/ST_EndPointTest.php +++ b/tests/Functions/ST_EndPointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_EndPoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_EnvelopeTest.php b/tests/Functions/ST_EnvelopeTest.php index b918f590..27624ceb 100644 --- a/tests/Functions/ST_EnvelopeTest.php +++ b/tests/Functions/ST_EnvelopeTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Envelope + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_EqualsTest.php b/tests/Functions/ST_EqualsTest.php index bb8b676c..ea0d5614 100644 --- a/tests/Functions/ST_EqualsTest.php +++ b/tests/Functions/ST_EqualsTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Equals + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ExtentTest.php b/tests/Functions/ST_ExtentTest.php index 461f40bd..b55d0ab2 100644 --- a/tests/Functions/ST_ExtentTest.php +++ b/tests/Functions/ST_ExtentTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Extent + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ExteriorRingTest.php b/tests/Functions/ST_ExteriorRingTest.php index 966121f2..775dd79a 100644 --- a/tests/Functions/ST_ExteriorRingTest.php +++ b/tests/Functions/ST_ExteriorRingTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_ExteriorRing + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_FlipCoordinatesTest.php b/tests/Functions/ST_FlipCoordinatesTest.php index cbd4971b..f446d450 100644 --- a/tests/Functions/ST_FlipCoordinatesTest.php +++ b/tests/Functions/ST_FlipCoordinatesTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_FlipCoordinates + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeoHashTest.php b/tests/Functions/ST_GeoHashTest.php index 34a06eea..450a0f17 100644 --- a/tests/Functions/ST_GeoHashTest.php +++ b/tests/Functions/ST_GeoHashTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeoHash + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeogFromTextTest.php b/tests/Functions/ST_GeogFromTextTest.php index b21c2428..7ce5a7da 100644 --- a/tests/Functions/ST_GeogFromTextTest.php +++ b/tests/Functions/ST_GeogFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeogFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeogFromWKBTest.php b/tests/Functions/ST_GeogFromWKBTest.php index 607a31ce..a5bc1339 100644 --- a/tests/Functions/ST_GeogFromWKBTest.php +++ b/tests/Functions/ST_GeogFromWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeogFromWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeographyFromTextTest.php b/tests/Functions/ST_GeographyFromTextTest.php index 181fa43b..272de84e 100644 --- a/tests/Functions/ST_GeographyFromTextTest.php +++ b/tests/Functions/ST_GeographyFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeographyFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomCollFromTextTest.php b/tests/Functions/ST_GeomCollFromTextTest.php index c1a3f1f6..4809b002 100644 --- a/tests/Functions/ST_GeomCollFromTextTest.php +++ b/tests/Functions/ST_GeomCollFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomCollFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromEWKBTest.php b/tests/Functions/ST_GeomFromEWKBTest.php index b857d433..c1d566c2 100644 --- a/tests/Functions/ST_GeomFromEWKBTest.php +++ b/tests/Functions/ST_GeomFromEWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromEWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromEWKTTest.php b/tests/Functions/ST_GeomFromEWKTTest.php index 5429d8c9..26fe2146 100644 --- a/tests/Functions/ST_GeomFromEWKTTest.php +++ b/tests/Functions/ST_GeomFromEWKTTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromEWKT + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromGMLTest.php b/tests/Functions/ST_GeomFromGMLTest.php index 1cffc5b3..ad3bbcaf 100644 --- a/tests/Functions/ST_GeomFromGMLTest.php +++ b/tests/Functions/ST_GeomFromGMLTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromGML + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromGeoHashTest.php b/tests/Functions/ST_GeomFromGeoHashTest.php index 831a9b7d..8cf0f2d8 100644 --- a/tests/Functions/ST_GeomFromGeoHashTest.php +++ b/tests/Functions/ST_GeomFromGeoHashTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromGeoHash + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromGeoJSONTest.php b/tests/Functions/ST_GeomFromGeoJSONTest.php index ea32cbab..b0a2b7ea 100644 --- a/tests/Functions/ST_GeomFromGeoJSONTest.php +++ b/tests/Functions/ST_GeomFromGeoJSONTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromGeoJSON + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromKMLTest.php b/tests/Functions/ST_GeomFromKMLTest.php index 5e569077..c4dc3f9d 100644 --- a/tests/Functions/ST_GeomFromKMLTest.php +++ b/tests/Functions/ST_GeomFromKMLTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromKML + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromTextTest.php b/tests/Functions/ST_GeomFromTextTest.php index ec4ae9df..cde6039a 100644 --- a/tests/Functions/ST_GeomFromTextTest.php +++ b/tests/Functions/ST_GeomFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeomFromWKBTest.php b/tests/Functions/ST_GeomFromWKBTest.php index 60a3594c..ec632954 100644 --- a/tests/Functions/ST_GeomFromWKBTest.php +++ b/tests/Functions/ST_GeomFromWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeomFromWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeometryFromTextTest.php b/tests/Functions/ST_GeometryFromTextTest.php index c8e80a41..e8f6e750 100644 --- a/tests/Functions/ST_GeometryFromTextTest.php +++ b/tests/Functions/ST_GeometryFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeometryFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeometryNTest.php b/tests/Functions/ST_GeometryNTest.php index 6b0fcc25..87eb2044 100644 --- a/tests/Functions/ST_GeometryNTest.php +++ b/tests/Functions/ST_GeometryNTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeometryN + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_GeometryTypeTest.php b/tests/Functions/ST_GeometryTypeTest.php index c2d366ce..0a6de751 100644 --- a/tests/Functions/ST_GeometryTypeTest.php +++ b/tests/Functions/ST_GeometryTypeTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_GeometryType + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_HasArcTest.php b/tests/Functions/ST_HasArcTest.php index f600fc26..d88da99e 100644 --- a/tests/Functions/ST_HasArcTest.php +++ b/tests/Functions/ST_HasArcTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_HasArc + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_HausdorffDistanceTest.php b/tests/Functions/ST_HausdorffDistanceTest.php index db8eafd3..e0ef4f28 100644 --- a/tests/Functions/ST_HausdorffDistanceTest.php +++ b/tests/Functions/ST_HausdorffDistanceTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_HausdorffDistance + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_InteriorRingNTest.php b/tests/Functions/ST_InteriorRingNTest.php index 1c707e8d..61aec6d2 100644 --- a/tests/Functions/ST_InteriorRingNTest.php +++ b/tests/Functions/ST_InteriorRingNTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_InteriorRingN + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IntersectionTest.php b/tests/Functions/ST_IntersectionTest.php index 88b05c2c..4d9e4f7a 100644 --- a/tests/Functions/ST_IntersectionTest.php +++ b/tests/Functions/ST_IntersectionTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Intersection + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IntersectsTest.php b/tests/Functions/ST_IntersectsTest.php index b1f3b2bd..bc7f624f 100644 --- a/tests/Functions/ST_IntersectsTest.php +++ b/tests/Functions/ST_IntersectsTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Intersects + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsClosedTest.php b/tests/Functions/ST_IsClosedTest.php index 8b637776..a88d1aa4 100644 --- a/tests/Functions/ST_IsClosedTest.php +++ b/tests/Functions/ST_IsClosedTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsClosed + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsCollectionTest.php b/tests/Functions/ST_IsCollectionTest.php index f36e061e..11bb1b16 100644 --- a/tests/Functions/ST_IsCollectionTest.php +++ b/tests/Functions/ST_IsCollectionTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsCollection + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsEmptyTest.php b/tests/Functions/ST_IsEmptyTest.php index 213397a4..25554d5c 100644 --- a/tests/Functions/ST_IsEmptyTest.php +++ b/tests/Functions/ST_IsEmptyTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsEmpty + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsRingTest.php b/tests/Functions/ST_IsRingTest.php index 286380ef..3d2c1269 100644 --- a/tests/Functions/ST_IsRingTest.php +++ b/tests/Functions/ST_IsRingTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsRing + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsSimpleTest.php b/tests/Functions/ST_IsSimpleTest.php index 2af187cd..54aab8a1 100644 --- a/tests/Functions/ST_IsSimpleTest.php +++ b/tests/Functions/ST_IsSimpleTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsSimple + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsValidDetailTest.php b/tests/Functions/ST_IsValidDetailTest.php index b36e42e0..70cae930 100644 --- a/tests/Functions/ST_IsValidDetailTest.php +++ b/tests/Functions/ST_IsValidDetailTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsValidDetail + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsValidReasonTest.php b/tests/Functions/ST_IsValidReasonTest.php index 924cf43a..7e613b4f 100644 --- a/tests/Functions/ST_IsValidReasonTest.php +++ b/tests/Functions/ST_IsValidReasonTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsValidReason + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_IsValidTest.php b/tests/Functions/ST_IsValidTest.php index cfd4b5fd..bf915a5b 100644 --- a/tests/Functions/ST_IsValidTest.php +++ b/tests/Functions/ST_IsValidTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_IsValid + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LengthSpheroidTest.php b/tests/Functions/ST_LengthSpheroidTest.php index 84756df0..ca2c2eed 100644 --- a/tests/Functions/ST_LengthSpheroidTest.php +++ b/tests/Functions/ST_LengthSpheroidTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_LengthSpheroid + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LengthTest.php b/tests/Functions/ST_LengthTest.php index 8d7a65ef..5fcbf408 100644 --- a/tests/Functions/ST_LengthTest.php +++ b/tests/Functions/ST_LengthTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Length + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LineCrossingDirectionTest.php b/tests/Functions/ST_LineCrossingDirectionTest.php index b96ecc62..24d9dcb9 100644 --- a/tests/Functions/ST_LineCrossingDirectionTest.php +++ b/tests/Functions/ST_LineCrossingDirectionTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_LineCrossingDirection + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LineFromMultiPointTest.php b/tests/Functions/ST_LineFromMultiPointTest.php index 87a8ffb1..b7e2b4c7 100644 --- a/tests/Functions/ST_LineFromMultiPointTest.php +++ b/tests/Functions/ST_LineFromMultiPointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_LineFromMultiPoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LineFromTextTest.php b/tests/Functions/ST_LineFromTextTest.php index 4cbc6312..1170fa22 100644 --- a/tests/Functions/ST_LineFromTextTest.php +++ b/tests/Functions/ST_LineFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_LineFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LineFromWKBTest.php b/tests/Functions/ST_LineFromWKBTest.php index 904835b8..d7a4f225 100644 --- a/tests/Functions/ST_LineFromWKBTest.php +++ b/tests/Functions/ST_LineFromWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_LineFromWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LinestringFromWKBTest.php b/tests/Functions/ST_LinestringFromWKBTest.php index df58d019..2ca258ad 100644 --- a/tests/Functions/ST_LinestringFromWKBTest.php +++ b/tests/Functions/ST_LinestringFromWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_LinestringFromWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_LongestLineTest.php b/tests/Functions/ST_LongestLineTest.php index 6b211981..a8970fe4 100644 --- a/tests/Functions/ST_LongestLineTest.php +++ b/tests/Functions/ST_LongestLineTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_LongestLine + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MLineFromTextTest.php b/tests/Functions/ST_MLineFromTextTest.php index 61606a5e..501cd9c4 100644 --- a/tests/Functions/ST_MLineFromTextTest.php +++ b/tests/Functions/ST_MLineFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MLineFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MPointFromTextTest.php b/tests/Functions/ST_MPointFromTextTest.php index 5c436f69..5f5a27b6 100644 --- a/tests/Functions/ST_MPointFromTextTest.php +++ b/tests/Functions/ST_MPointFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MPointFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MPolyFromTextTest.php b/tests/Functions/ST_MPolyFromTextTest.php index 6a2b3c84..0a1ce1d2 100644 --- a/tests/Functions/ST_MPolyFromTextTest.php +++ b/tests/Functions/ST_MPolyFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MPolyFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MTest.php b/tests/Functions/ST_MTest.php index d83095d5..316e2ab8 100644 --- a/tests/Functions/ST_MTest.php +++ b/tests/Functions/ST_MTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_M + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MakeBox2DTest.php b/tests/Functions/ST_MakeBox2DTest.php index 7c8633c0..19843a14 100644 --- a/tests/Functions/ST_MakeBox2DTest.php +++ b/tests/Functions/ST_MakeBox2DTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MakeBox2D + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MakeEnvelopeTest.php b/tests/Functions/ST_MakeEnvelopeTest.php index eec675dc..dd0b8678 100644 --- a/tests/Functions/ST_MakeEnvelopeTest.php +++ b/tests/Functions/ST_MakeEnvelopeTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MakeEnvelope + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MakeLineTest.php b/tests/Functions/ST_MakeLineTest.php index 11f64c61..e7a930d7 100644 --- a/tests/Functions/ST_MakeLineTest.php +++ b/tests/Functions/ST_MakeLineTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MakeLine + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MakePointMTest.php b/tests/Functions/ST_MakePointMTest.php index fcc91f16..460bb6bf 100644 --- a/tests/Functions/ST_MakePointMTest.php +++ b/tests/Functions/ST_MakePointMTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MakePointM + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MakePointTest.php b/tests/Functions/ST_MakePointTest.php index a24fd044..8c9c5eed 100644 --- a/tests/Functions/ST_MakePointTest.php +++ b/tests/Functions/ST_MakePointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MakePoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MakePolygonTest.php b/tests/Functions/ST_MakePolygonTest.php index 07b0a773..4730a114 100644 --- a/tests/Functions/ST_MakePolygonTest.php +++ b/tests/Functions/ST_MakePolygonTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MakePolygon + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MaxDistanceTest.php b/tests/Functions/ST_MaxDistanceTest.php index d58bd2f4..c0719f3f 100644 --- a/tests/Functions/ST_MaxDistanceTest.php +++ b/tests/Functions/ST_MaxDistanceTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MaxDistance + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MinimumBoundingCircleTest.php b/tests/Functions/ST_MinimumBoundingCircleTest.php index 9cca74e3..27fc25bb 100644 --- a/tests/Functions/ST_MinimumBoundingCircleTest.php +++ b/tests/Functions/ST_MinimumBoundingCircleTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_MinimumBoundingCircle + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_MultiTest.php b/tests/Functions/ST_MultiTest.php index 012d8742..3dfb8567 100644 --- a/tests/Functions/ST_MultiTest.php +++ b/tests/Functions/ST_MultiTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Multi + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NDimsTest.php b/tests/Functions/ST_NDimsTest.php index e2dfc697..010e4396 100644 --- a/tests/Functions/ST_NDimsTest.php +++ b/tests/Functions/ST_NDimsTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NDims + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NPointsTest.php b/tests/Functions/ST_NPointsTest.php index a117be93..33dba3fa 100644 --- a/tests/Functions/ST_NPointsTest.php +++ b/tests/Functions/ST_NPointsTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NPoints + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NRingsTest.php b/tests/Functions/ST_NRingsTest.php index 83764d7b..511d5f1c 100644 --- a/tests/Functions/ST_NRingsTest.php +++ b/tests/Functions/ST_NRingsTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NRings + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NumGeometriesTest.php b/tests/Functions/ST_NumGeometriesTest.php index ef2927b3..b64ff600 100644 --- a/tests/Functions/ST_NumGeometriesTest.php +++ b/tests/Functions/ST_NumGeometriesTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NumGeometries + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NumInteriorRingTest.php b/tests/Functions/ST_NumInteriorRingTest.php index 5921a745..86acdd72 100644 --- a/tests/Functions/ST_NumInteriorRingTest.php +++ b/tests/Functions/ST_NumInteriorRingTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NumInteriorRing + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NumInteriorRingsTest.php b/tests/Functions/ST_NumInteriorRingsTest.php index bd78404d..69f16e8e 100644 --- a/tests/Functions/ST_NumInteriorRingsTest.php +++ b/tests/Functions/ST_NumInteriorRingsTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NumInteriorRings + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NumPatchesTest.php b/tests/Functions/ST_NumPatchesTest.php index 39c6335e..61ca6cac 100644 --- a/tests/Functions/ST_NumPatchesTest.php +++ b/tests/Functions/ST_NumPatchesTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NumPatches + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_NumPointsTest.php b/tests/Functions/ST_NumPointsTest.php index 15e609e7..a7bb39aa 100644 --- a/tests/Functions/ST_NumPointsTest.php +++ b/tests/Functions/ST_NumPointsTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_NumPoints + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_OrderingEqualsTest.php b/tests/Functions/ST_OrderingEqualsTest.php index daf3229c..79ee2657 100644 --- a/tests/Functions/ST_OrderingEqualsTest.php +++ b/tests/Functions/ST_OrderingEqualsTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_OrderingEquals + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_OverlapsTest.php b/tests/Functions/ST_OverlapsTest.php index e012a3df..7e304f4c 100644 --- a/tests/Functions/ST_OverlapsTest.php +++ b/tests/Functions/ST_OverlapsTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Overlaps + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PatchNTest.php b/tests/Functions/ST_PatchNTest.php index 2f9d6ec5..a6843f7f 100644 --- a/tests/Functions/ST_PatchNTest.php +++ b/tests/Functions/ST_PatchNTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_PatchN + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PerimeterTest.php b/tests/Functions/ST_PerimeterTest.php index 054e2e39..e4a8b1ea 100644 --- a/tests/Functions/ST_PerimeterTest.php +++ b/tests/Functions/ST_PerimeterTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Perimeter + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PointFromGeoHashTest.php b/tests/Functions/ST_PointFromGeoHashTest.php index 28bab1ba..2ef00337 100644 --- a/tests/Functions/ST_PointFromGeoHashTest.php +++ b/tests/Functions/ST_PointFromGeoHashTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_PointFromGeoHash + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PointFromTextTest.php b/tests/Functions/ST_PointFromTextTest.php index 9cb706ed..6c257f5f 100644 --- a/tests/Functions/ST_PointFromTextTest.php +++ b/tests/Functions/ST_PointFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_PointFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PointFromWKBTest.php b/tests/Functions/ST_PointFromWKBTest.php index fcb2863b..032d07d7 100644 --- a/tests/Functions/ST_PointFromWKBTest.php +++ b/tests/Functions/ST_PointFromWKBTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_PointFromWKB + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PointNTest.php b/tests/Functions/ST_PointNTest.php index 2ab49c2e..d94e4781 100644 --- a/tests/Functions/ST_PointNTest.php +++ b/tests/Functions/ST_PointNTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_PointN + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PointOnSurfaceTest.php b/tests/Functions/ST_PointOnSurfaceTest.php index be0b87c6..803af80e 100644 --- a/tests/Functions/ST_PointOnSurfaceTest.php +++ b/tests/Functions/ST_PointOnSurfaceTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_PointOnSurface + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PointTest.php b/tests/Functions/ST_PointTest.php index 90ea5ea4..19468858 100644 --- a/tests/Functions/ST_PointTest.php +++ b/tests/Functions/ST_PointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Point + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PolygonFromTextTest.php b/tests/Functions/ST_PolygonFromTextTest.php index a20c3bc9..9f351c0e 100644 --- a/tests/Functions/ST_PolygonFromTextTest.php +++ b/tests/Functions/ST_PolygonFromTextTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_PolygonFromText + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_PolygonTest.php b/tests/Functions/ST_PolygonTest.php index 731848fb..659718a9 100644 --- a/tests/Functions/ST_PolygonTest.php +++ b/tests/Functions/ST_PolygonTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Polygon + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ProjectTest.php b/tests/Functions/ST_ProjectTest.php index 8367d83a..ef800e4f 100644 --- a/tests/Functions/ST_ProjectTest.php +++ b/tests/Functions/ST_ProjectTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Project + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_RelateTest.php b/tests/Functions/ST_RelateTest.php index 0a136ffb..8c19d0e1 100644 --- a/tests/Functions/ST_RelateTest.php +++ b/tests/Functions/ST_RelateTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Relate + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_SRIDTest.php b/tests/Functions/ST_SRIDTest.php index 91656a16..e53dea75 100644 --- a/tests/Functions/ST_SRIDTest.php +++ b/tests/Functions/ST_SRIDTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_SRID + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ScaleTest.php b/tests/Functions/ST_ScaleTest.php index 18f7cc94..62e2676e 100644 --- a/tests/Functions/ST_ScaleTest.php +++ b/tests/Functions/ST_ScaleTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Scale + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_SetSRIDTest.php b/tests/Functions/ST_SetSRIDTest.php index d2e2ce72..a88ea3e5 100644 --- a/tests/Functions/ST_SetSRIDTest.php +++ b/tests/Functions/ST_SetSRIDTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_SetSRID + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ShiftLongitudeTest.php b/tests/Functions/ST_ShiftLongitudeTest.php index 1955013f..faea8a0d 100644 --- a/tests/Functions/ST_ShiftLongitudeTest.php +++ b/tests/Functions/ST_ShiftLongitudeTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_ShiftLongitude + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ShortestLineTest.php b/tests/Functions/ST_ShortestLineTest.php index 3e702ce9..68532985 100644 --- a/tests/Functions/ST_ShortestLineTest.php +++ b/tests/Functions/ST_ShortestLineTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_ShortestLine + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_SnapToGridTest.php b/tests/Functions/ST_SnapToGridTest.php index 87538f26..e8c9a3fb 100644 --- a/tests/Functions/ST_SnapToGridTest.php +++ b/tests/Functions/ST_SnapToGridTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_SnapToGrid + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_SplitTest.php b/tests/Functions/ST_SplitTest.php index b8877620..90e07c1e 100644 --- a/tests/Functions/ST_SplitTest.php +++ b/tests/Functions/ST_SplitTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Split + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_StartPointTest.php b/tests/Functions/ST_StartPointTest.php index c2bc5b20..a110a0cf 100644 --- a/tests/Functions/ST_StartPointTest.php +++ b/tests/Functions/ST_StartPointTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_StartPoint + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_SummaryTest.php b/tests/Functions/ST_SummaryTest.php index 007b7432..72e6bede 100644 --- a/tests/Functions/ST_SummaryTest.php +++ b/tests/Functions/ST_SummaryTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Summary + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_SymDifferenceTest.php b/tests/Functions/ST_SymDifferenceTest.php index 9566a485..92fd0904 100644 --- a/tests/Functions/ST_SymDifferenceTest.php +++ b/tests/Functions/ST_SymDifferenceTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_SymDifference + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_TouchesTest.php b/tests/Functions/ST_TouchesTest.php index 559b9a6c..014315e2 100644 --- a/tests/Functions/ST_TouchesTest.php +++ b/tests/Functions/ST_TouchesTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Touches + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_TransScaleTest.php b/tests/Functions/ST_TransScaleTest.php index 4b333cd2..d433720e 100644 --- a/tests/Functions/ST_TransScaleTest.php +++ b/tests/Functions/ST_TransScaleTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_TransScale + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_TransformTest.php b/tests/Functions/ST_TransformTest.php index e535517a..52e3491a 100644 --- a/tests/Functions/ST_TransformTest.php +++ b/tests/Functions/ST_TransformTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Transform + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_TranslateTest.php b/tests/Functions/ST_TranslateTest.php index 7f49b80a..f9e3fff9 100644 --- a/tests/Functions/ST_TranslateTest.php +++ b/tests/Functions/ST_TranslateTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Translate + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_UnionTest.php b/tests/Functions/ST_UnionTest.php index 5cc3ca66..cf4bb273 100644 --- a/tests/Functions/ST_UnionTest.php +++ b/tests/Functions/ST_UnionTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Union + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_WithinTest.php b/tests/Functions/ST_WithinTest.php index a577c155..7d1df067 100644 --- a/tests/Functions/ST_WithinTest.php +++ b/tests/Functions/ST_WithinTest.php @@ -13,6 +13,8 @@ use function is_string; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Within + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_XMaxTest.php b/tests/Functions/ST_XMaxTest.php index cd3c44a9..2ef03e94 100644 --- a/tests/Functions/ST_XMaxTest.php +++ b/tests/Functions/ST_XMaxTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_XMax + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_XMinTest.php b/tests/Functions/ST_XMinTest.php index 1ea90792..5c8a51a6 100644 --- a/tests/Functions/ST_XMinTest.php +++ b/tests/Functions/ST_XMinTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_XMin + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_XTest.php b/tests/Functions/ST_XTest.php index 833fbfa0..f56dfd67 100644 --- a/tests/Functions/ST_XTest.php +++ b/tests/Functions/ST_XTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_X + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_YMaxTest.php b/tests/Functions/ST_YMaxTest.php index 4ed2bb65..33afda94 100644 --- a/tests/Functions/ST_YMaxTest.php +++ b/tests/Functions/ST_YMaxTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_YMax + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_YMinTest.php b/tests/Functions/ST_YMinTest.php index 7c803a9a..b227d4cf 100644 --- a/tests/Functions/ST_YMinTest.php +++ b/tests/Functions/ST_YMinTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_YMin + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_YTest.php b/tests/Functions/ST_YTest.php index da616cfa..0249b3e0 100644 --- a/tests/Functions/ST_YTest.php +++ b/tests/Functions/ST_YTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Y + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ZMaxTest.php b/tests/Functions/ST_ZMaxTest.php index 2a606b34..2cfb94f0 100644 --- a/tests/Functions/ST_ZMaxTest.php +++ b/tests/Functions/ST_ZMaxTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_ZMax + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ZMinTest.php b/tests/Functions/ST_ZMinTest.php index 9fd1d6ae..b792b80b 100644 --- a/tests/Functions/ST_ZMinTest.php +++ b/tests/Functions/ST_ZMinTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_ZMin + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ZTest.php b/tests/Functions/ST_ZTest.php index 15af1f62..b971ea19 100644 --- a/tests/Functions/ST_ZTest.php +++ b/tests/Functions/ST_ZTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Z + * * @group orm * @group functions */ diff --git a/tests/Functions/ST_ZmflagTest.php b/tests/Functions/ST_ZmflagTest.php index eb36d9bb..011a7696 100644 --- a/tests/Functions/ST_ZmflagTest.php +++ b/tests/Functions/ST_ZmflagTest.php @@ -12,6 +12,8 @@ use function is_resource; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ST_Zmflag + * * @group orm * @group functions */ diff --git a/tools/generate-functions.php b/tools/generate-functions.php index 8821ad21..5108d7ee 100644 --- a/tools/generate-functions.php +++ b/tools/generate-functions.php @@ -148,6 +148,8 @@ function get_function_test_class_code($name, $options) use Jsor\Doctrine\PostGIS\Entity\PointsEntity; /** + * @covers \Jsor\Doctrine\PostGIS\Functions\ + * * @group orm * @group functions From 69903ed9363e4444d9b51bdd2ce5851a32e0713b Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 17:23:38 +0200 Subject: [PATCH 06/19] Update existing tests and add new tests cover added classes --- tests/AbstractFunctionalTestCase.php | 50 +- tests/AbstractTestCase.php | 2 +- tests/Driver/DriverTest.php | 76 +++ tests/Driver/MiddlewareTest.php | 23 + tests/Driver/PostGISPlatformTest.php | 216 +++++++++ tests/Event/DBALSchemaEventSubscriberTest.php | 438 ------------------ ...est.php => ORMSchemaEventListenerTest.php} | 10 +- tests/Schema/SchemaManagerFactoryTest.php | 34 ++ tests/Schema/SchemaManagerTest.php | 411 +++++++++++++++- tests/Schema/SpatialIndexSqlGeneratorTest.php | 61 +++ tests/Schema/SpatialIndexesTest.php | 131 ++++++ tests/Types/AbstractTypeTestCase.php | 2 +- tests/fixtures/Types/GeoJsonType.php | 59 +++ 13 files changed, 1052 insertions(+), 461 deletions(-) create mode 100644 tests/Driver/DriverTest.php create mode 100644 tests/Driver/MiddlewareTest.php create mode 100644 tests/Driver/PostGISPlatformTest.php delete mode 100644 tests/Event/DBALSchemaEventSubscriberTest.php rename tests/Event/{ORMSchemaEventSubscriberTest.php => ORMSchemaEventListenerTest.php} (90%) create mode 100644 tests/Schema/SchemaManagerFactoryTest.php create mode 100644 tests/Schema/SpatialIndexSqlGeneratorTest.php create mode 100644 tests/Schema/SpatialIndexesTest.php create mode 100644 tests/fixtures/Types/GeoJsonType.php diff --git a/tests/AbstractFunctionalTestCase.php b/tests/AbstractFunctionalTestCase.php index 67d06043..596eaca0 100644 --- a/tests/AbstractFunctionalTestCase.php +++ b/tests/AbstractFunctionalTestCase.php @@ -4,6 +4,7 @@ namespace Jsor\Doctrine\PostGIS; +use Doctrine\Common\EventManager; use Doctrine\DBAL\Configuration as DBALConfiguration; use Doctrine\DBAL\Connection; use Doctrine\DBAL\DriverManager; @@ -13,11 +14,13 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\Driver\AttributeDriver; use Doctrine\ORM\Tools\SchemaTool; +use Doctrine\ORM\Tools\ToolEvents; use Doctrine\Persistence\Mapping\Driver\MappingDriver; -use Jsor\Doctrine\PostGIS\Event\DBALSchemaEventSubscriber; -use Jsor\Doctrine\PostGIS\Event\ORMSchemaEventSubscriber; +use Jsor\Doctrine\PostGIS\Driver\Middleware; +use Jsor\Doctrine\PostGIS\Event\ORMSchemaEventListener; use Jsor\Doctrine\PostGIS\Functions\Configurator; -use Symfony\Bridge\Doctrine\SchemaListener\MessengerTransportDoctrineSchemaSubscriber; +use Jsor\Doctrine\PostGIS\Schema\SchemaManagerFactory; +use Symfony\Bridge\Doctrine\SchemaListener\MessengerTransportDoctrineSchemaListener; use Symfony\Component\Messenger\Bridge\Doctrine\Transport\Connection as MessengerConnection; use Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineTransport; use Symfony\Component\Messenger\Bridge\Doctrine\Transport\PostgreSqlConnection; @@ -27,6 +30,8 @@ abstract class AbstractFunctionalTestCase extends AbstractTestCase { private static ?Connection $_conn = null; + private static ?EventManager $_eventManager = null; + private static ?MessengerConnection $_messengerConn = null; /** @@ -38,6 +43,13 @@ abstract class AbstractFunctionalTestCase extends AbstractTestCase private ?SchemaTool $_schemaTool = null; + protected function setUp(): void + { + parent::setUp(); + + static::_registerTypes(); + } + protected function tearDown(): void { parent::tearDown(); @@ -88,15 +100,28 @@ protected function _getDbParams(): array ]; } + protected function _getEventManager(): EventManager + { + if (!self::$_eventManager) { + self::$_eventManager = new EventManager(); + } + + return self::$_eventManager; + } + protected function _getConnection(): Connection { if (!isset(self::$_conn)) { if (class_exists(ORMConfiguration::class)) { - self::$_conn = DriverManager::getConnection($this->_getDbParams(), new ORMConfiguration()); - Configurator::configure(self::$_conn->getConfiguration()); + $config = new ORMConfiguration(); + Configurator::configure($config); } else { - self::$_conn = DriverManager::getConnection($this->_getDbParams(), new DBALConfiguration()); + $config = new DBALConfiguration(); } + $config->setMiddlewares([new Middleware()]); + $config->setSchemaManagerFactory(new SchemaManagerFactory()); + + self::$_conn = DriverManager::getConnection($this->_getDbParams(), $config, $this->_getEventManager()); self::$_messengerConn = new PostgreSqlConnection( [ @@ -106,8 +131,9 @@ protected function _getConnection(): Connection self::$_conn, ); - self::$_conn->getEventManager()->addEventSubscriber( - new MessengerTransportDoctrineSchemaSubscriber( + $this->_getEventManager()->addEventListener( + ToolEvents::postGenerateSchema, + new MessengerTransportDoctrineSchemaListener( [ new DoctrineTransport( self::$_messengerConn, @@ -118,9 +144,7 @@ protected function _getConnection(): Connection ); if (class_exists(ORMConfiguration::class)) { - self::$_conn->getEventManager()->addEventSubscriber(new ORMSchemaEventSubscriber()); - } else { - self::$_conn->getEventManager()->addEventSubscriber(new DBALSchemaEventSubscriber()); + $this->_getEventManager()->addEventListener('postGenerateSchemaTable', new ORMSchemaEventListener()); } if (!Type::hasType('tsvector')) { @@ -145,7 +169,7 @@ protected function _getMessengerConnection(): MessengerConnection return self::$_messengerConn; } - protected function _getEntityManager(?ORMConfiguration $config = null): EntityManager + protected function _getEntityManager(?ORMConfiguration $config = null): EntityManagerInterface { if (null !== $this->_em) { return $this->_em; @@ -159,7 +183,7 @@ protected function _getEntityManager(?ORMConfiguration $config = null): EntityMa $this->_setupConfiguration($config); - $em = EntityManager::create($connection, $config); + $em = new EntityManager($connection, $config, $this->_getEventManager()); return $this->_em = $em; } diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index 2d1376a0..09907e4c 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -12,7 +12,7 @@ abstract class AbstractTestCase extends TestCase { - protected function _registerTypes(): void + protected static function _registerTypes(): void { if (!Type::hasType('geometry')) { Type::addType('geometry', GeometryType::class); diff --git a/tests/Driver/DriverTest.php b/tests/Driver/DriverTest.php new file mode 100644 index 00000000..e9b055b1 --- /dev/null +++ b/tests/Driver/DriverTest.php @@ -0,0 +1,76 @@ +getDriver(); + $driver->connect([ + 'driver' => getenv('DB_TYPE'), + 'user' => getenv('DB_USER'), + 'password' => getenv('DB_PASSWORD'), + 'host' => getenv('DB_HOST'), + 'dbname' => getenv('DB_NAME'), + 'port' => getenv('DB_PORT'), + ]); + + static::assertTrue(Type::hasType(PostGISType::GEOGRAPHY)); + static::assertTrue(Type::hasType(PostGISType::GEOMETRY)); + } + + public function testGetDatabasePlatform(): void + { + $driver = $this->getDriver(); + + static::assertInstanceOf(PostGISPlatform::class, $driver->getDatabasePlatform()); + } + + public function providerVersions(): iterable + { + yield [11]; + yield [12]; + yield [13]; + yield [14]; + yield [15]; + } + + /** @dataProvider providerVersions */ + public function testCreateDatabasePlatformForVersion(int $version): void + { + $driver = $this->getDriver(); + + static::assertInstanceOf(PostGISPlatform::class, $driver->createDatabasePlatformForVersion($version)); + } + + public function testGetExceptionConverter(): void + { + $driver = $this->getDriver(); + + static::assertInstanceOf(ExceptionConverter::class, $driver->getExceptionConverter()); + } + + private function getDriver(): Driver + { + return new Driver(new PgSQLDriver()); + } +} diff --git a/tests/Driver/MiddlewareTest.php b/tests/Driver/MiddlewareTest.php new file mode 100644 index 00000000..e6705692 --- /dev/null +++ b/tests/Driver/MiddlewareTest.php @@ -0,0 +1,23 @@ +wrap(new PgSQLDriver())); + } +} diff --git a/tests/Driver/PostGISPlatformTest.php b/tests/Driver/PostGISPlatformTest.php new file mode 100644 index 00000000..7f6fdc05 --- /dev/null +++ b/tests/Driver/PostGISPlatformTest.php @@ -0,0 +1,216 @@ +_execFile('points_drop.sql'); + $this->_execFile('points_create.sql'); + + $this->sm = $this->_getConnection()->createSchemaManager(); + } + + protected function tearDown(): void + { + parent::tearDown(); + + $this->_execFile('points_drop.sql'); + } + + public function testCreateSchemaManager(): void + { + $platform = new PostGISPlatform(); + $schemaManager = $platform->createSchemaManager($this->_getConnection()); + + static::assertInstanceOf(SchemaManager::class, $schemaManager); + } + + public function providerAlterSql(): iterable + { + static::_registerTypes(); + + $baseTable = new Table('points'); + $baseTable->addColumn('id', 'integer'); + $baseTable->addColumn('text', 'text'); + $baseTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + + $table = $baseTable; + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->addedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); + $schemaDiff = new SchemaDiff(); + $schemaDiff->changedTables[] = $tableDiff; + + yield 'Create index' => [$schemaDiff, ['CREATE INDEX point_idx ON points USING gist(point)'], []]; + + $table = $baseTable; + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->addedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); + $tableDiff->changedColumns[] = new ColumnDiff( + 'point', + new Column('point', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]), + ['srid'], + new Column('point', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'point', 'srid' => 4326]]), + ); + $schemaDiff = new SchemaDiff(); + $schemaDiff->changedTables[] = $tableDiff; + + yield 'Modify SRID' => [$schemaDiff, ['CREATE INDEX point_idx ON points USING gist(point)'], []]; + + $tableDiff = new TableDiff('points'); + $tableDiff->addedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); + $schemaDiff = new SchemaDiff(); + $schemaDiff->changedTables[] = $tableDiff; + + yield 'Missing fromTable' => [$schemaDiff, [], ['CREATE INDEX point_idx ON points USING gist(point)']]; + } + + /** @dataProvider providerAlterSql */ + public function testGetAlterSchemaSql(SchemaDiff $schemaDiff, array $expected, array $unexpected): void + { + $sql = (new PostGISPlatform())->getAlterSchemaSQL($schemaDiff); + + static::assertIndexes($expected, $unexpected, $sql); + } + + /** @dataProvider providerAlterSql */ + public function testGetAlterTableSQL(SchemaDiff $schemaDiff, array $expected, array $unexpected): void + { + $tableDiffs = $schemaDiff->getAlteredTables(); + $sql = (new PostGISPlatform())->getAlterTableSQL($tableDiffs[0]); + + static::assertIndexes($expected, $unexpected, $sql); + } + + public function testGetAlterTableSQLCustomType(): void + { + if (!Type::hasType('geojson')) { + Type::addType('geojson', GeoJsonType::class); + } + + $table = new Table('points'); + $table->addColumn('id', 'integer'); + $table->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + $tableDiff = new TableDiff('points'); + $tableDiff->addedColumns[] = new Column('boundary', Type::getType('geojson'), ['platformOptions' => ['geometry_type' => 'multipolygon', 'srid' => 3785]]); + $tableDiff->changedColumns[] = new ColumnDiff('point', new Column('point', Type::getType('geojson'), ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]), ['type']); + + $sql = (new PostGISPlatform())->getAlterTableSQL($tableDiff); + + static::assertContains('ALTER TABLE points ADD boundary geojson(MULTIPOLYGON, 3785) NOT NULL', $sql); + static::assertContains('ALTER TABLE points ALTER point TYPE geojson(POINT, 3785)', $sql); + } + + public function testGetCreateTableSql(): void + { + $table = $this->sm->introspectTable('points'); + + $sql = (new PostGISPlatform())->getCreateTableSQL($table); + + static::assertCreateTableSql($sql); + } + + public function testGetCreateTablesSql(): void + { + $table1 = $this->sm->introspectTable('points'); + $table2 = new Table('places'); + $table2->addColumn('id', 'integer'); + $table2->addColumn('points_id', 'integer'); + $table2->setPrimaryKey(['id']); + $table2->addForeignKeyConstraint($table1, ['points_id'], ['id']); + + $sql = (new PostGISPlatform())->getCreateTablesSQL([$table1, $table2]); + + static::assertCreateTableSql($sql); + static::assertContains('ALTER TABLE places ADD CONSTRAINT FK_FEAF6C55DF69572F FOREIGN KEY (points_id) REFERENCES points (id) NOT DEFERRABLE INITIALLY IMMEDIATE', $sql); + } + + public function testGetCreateTableSqlSkipsAlreadyAddedTable(): void + { + $schema = new Schema([], [], $this->sm->createSchemaConfig()); + + $this->_getMessengerConnection()->configureSchema($schema, $this->_getConnection(), fn () => true); + + $sql = $this->_getConnection()->getDatabasePlatform()->getCreateTableSQL($schema->getTable('messenger_messages')); + + $expected = $sql[0]; + $this->assertStringStartsWith('CREATE TABLE messenger_messages', $expected); + + unset($sql[0]); + + // Assert that the CREATE TABLE statement for the messenger_messages + // table exists only once + $this->assertNotContains($expected, $sql); + } + + public function testGetDropTableSql(): void + { + $table = $this->sm->introspectTable('points'); + + $sql = $this->_getConnection()->getDatabasePlatform()->getDropTableSQL($table); + + $this->assertEquals('DROP TABLE points', $sql); + } + + private static function assertCreateTableSql(array $sql): void + { + $expected = 'CREATE TABLE points (id INT NOT NULL, text TEXT NOT NULL, tsvector TEXT NOT NULL, geometry geometry(GEOMETRY, 0) NOT NULL, point geometry(POINT, 0) NOT NULL, point_2d geometry(POINT, 3785) NOT NULL, point_3dz geometry(POINTZ, 3785) NOT NULL, point_3dm geometry(POINTM, 3785) NOT NULL, point_4d geometry(POINTZM, 3785) NOT NULL, point_2d_nullable geometry(POINT, 3785) DEFAULT NULL, point_2d_nosrid geometry(POINT, 0) NOT NULL, geography geography(GEOMETRY, 4326) NOT NULL, point_geography_2d geography(POINT, 4326) NOT NULL, point_geography_2d_srid geography(POINT, 4326) NOT NULL, PRIMARY KEY(id))'; + static::assertContains($expected, $sql); + + static::assertContains("COMMENT ON TABLE points IS 'This is a comment for table points'", $sql); + static::assertContains("COMMENT ON COLUMN points.point IS 'This is a comment for column point'", $sql); + + $spatialIndexes = [ + 'CREATE INDEX idx_27ba8e29b7a5f324 ON points USING gist(point)', + 'CREATE INDEX idx_27ba8e2999674a3d ON points USING gist(point_2d)', + 'CREATE INDEX idx_27ba8e293be136c3 ON points USING gist(point_3dz)', + 'CREATE INDEX idx_27ba8e29b832b304 ON points USING gist(point_3dm)', + 'CREATE INDEX idx_27ba8e29cf3dedbb ON points USING gist(point_4d)', + 'CREATE INDEX idx_27ba8e293c257075 ON points USING gist(point_2d_nullable)', + 'CREATE INDEX idx_27ba8e293d5fe69e ON points USING gist(point_2d_nosrid)', + 'CREATE INDEX idx_27ba8e295f51a43c ON points USING gist(point_geography_2d)', + 'CREATE INDEX idx_27ba8e295afbb72d ON points USING gist(point_geography_2d_srid)', + ]; + + foreach ($spatialIndexes as $spatialIndex) { + static::assertContains($spatialIndex, $sql); + } + } + + private static function assertIndexes(array $expected, array $unexpected, array $sql): void + { + foreach ($expected as $spatialIndex) { + static::assertContains($spatialIndex, $sql); + } + foreach ($unexpected as $spatialIndex) { + static::assertNotContains($spatialIndex, $sql); + } + } +} diff --git a/tests/Event/DBALSchemaEventSubscriberTest.php b/tests/Event/DBALSchemaEventSubscriberTest.php deleted file mode 100644 index c91f2425..00000000 --- a/tests/Event/DBALSchemaEventSubscriberTest.php +++ /dev/null @@ -1,438 +0,0 @@ -_execFile('points_drop.sql'); - $this->_execFile('points_create.sql'); - - $this->sm = $this->_getConnection()->getSchemaManager(); - } - - protected function tearDown(): void - { - parent::tearDown(); - - $this->_execFile('points_drop.sql'); - } - - private function createTableSchema(): Table - { - $table = new Table('points'); - $table->addColumn('id', 'integer', ['notnull' => true]); - $table->addColumn('text', 'text', ['notnull' => true]); - $table->addColumn('tsvector', 'tsvector', ['notnull' => true]); - - $table->addColumn('geometry', 'geometry', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'GEOMETRY', - 'srid' => 0, - ]); - - $table->addColumn('point', 'geometry', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINT', - 'srid' => 0, - ]) - ->setComment('This is a comment for column point'); - - $table->addColumn('point_2d', 'geometry', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINT', - 'srid' => 3785, - ]); - - $table->addColumn('point_3dz', 'geometry', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINTZ', - 'srid' => 3785, - ]); - - $table->addColumn('point_3dm', 'geometry', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINTM', - 'srid' => 3785, - ]); - - $table->addColumn('point_4d', 'geometry', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINTZM', - 'srid' => 3785, - ]); - - $table->addColumn('point_2d_nullable', 'geometry', ['notnull' => false]) - ->setPlatformOptions([ - 'geometry_type' => 'POINT', - 'srid' => 3785, - ]); - - $table->addColumn('point_2d_nosrid', 'geometry', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINT', - 'srid' => 0, - ]); - - $table->addColumn('geography', 'geography', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'GEOMETRY', - 'srid' => 4326, - ]); - - $table->addColumn('point_geography_2d', 'geography', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINT', - 'srid' => 4326, - ]); - - $table->addColumn('point_geography_2d_srid', 'geography', ['notnull' => true]) - ->setPlatformOptions([ - 'geometry_type' => 'POINT', - 'srid' => 4326, - ]); - - $table->addIndex(['text'], 'idx_text'); - $table->addIndex(['tsvector'], 'idx_text_gist'); - - $table->addIndex(['point'], null, ['spatial']); - $table->addIndex(['point_2d'], null, ['spatial']); - $table->addIndex(['point_3dz'], null, ['spatial']); - $table->addIndex(['point_3dm'], null, ['spatial']); - $table->addIndex(['point_4d'], null, ['spatial']); - $table->addIndex(['point_2d_nullable'], null, ['spatial']); - $table->addIndex(['point_2d_nosrid'], null, ['spatial']); - $table->addIndex(['point_geography_2d'], null, ['spatial']); - $table->addIndex(['point_geography_2d_srid'], null, ['spatial']); - - $table->setComment('This is a comment for table points'); - - $table->setPrimaryKey(['id']); - - return $table; - } - - public function testListTableColumns(): void - { - $columns = $this->sm->listTableColumns('points'); - - $this->assertArrayHasKey('point', $columns); - $this->assertEquals('point', strtolower($columns['point']->getName())); - $this->assertInstanceOf(GeometryType::class, $columns['point']->getType()); - $this->assertFalse($columns['point']->getUnsigned()); - $this->assertTrue($columns['point']->getNotnull()); - $this->assertNull($columns['point']->getDefault()); - $this->assertIsArray($columns['point']->getPlatformOptions()); - - $this->assertEquals('POINT', $columns['point']->getPlatformOption('geometry_type')); - $this->assertEquals(0, $columns['point']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_2d', $columns); - $this->assertEquals('point_2d', strtolower($columns['point_2d']->getName())); - $this->assertInstanceOf(GeometryType::class, $columns['point_2d']->getType()); - $this->assertFalse($columns['point_2d']->getUnsigned()); - $this->assertTrue($columns['point_2d']->getNotnull()); - $this->assertNull($columns['point_2d']->getDefault()); - $this->assertIsArray($columns['point_2d']->getPlatformOptions()); - - $this->assertEquals('POINT', $columns['point_2d']->getPlatformOption('geometry_type')); - $this->assertEquals(3785, $columns['point_2d']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_3dz', $columns); - $this->assertEquals('point_3dz', strtolower($columns['point_3dz']->getName())); - $this->assertInstanceOf(GeometryType::class, $columns['point_3dz']->getType()); - $this->assertFalse($columns['point_3dz']->getUnsigned()); - $this->assertTrue($columns['point_3dz']->getNotnull()); - $this->assertNull($columns['point_3dz']->getDefault()); - $this->assertIsArray($columns['point_3dz']->getPlatformOptions()); - - $this->assertEquals('POINTZ', $columns['point_3dz']->getPlatformOption('geometry_type')); - $this->assertEquals(3785, $columns['point_3dz']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_3dm', $columns); - $this->assertEquals('point_3dm', strtolower($columns['point_3dm']->getName())); - $this->assertInstanceOf(GeometryType::class, $columns['point_3dm']->getType()); - $this->assertFalse($columns['point_3dm']->getUnsigned()); - $this->assertTrue($columns['point_3dm']->getNotnull()); - $this->assertNull($columns['point_3dm']->getDefault()); - $this->assertIsArray($columns['point_3dm']->getPlatformOptions()); - - $this->assertEquals('POINTM', $columns['point_3dm']->getPlatformOption('geometry_type')); - $this->assertEquals(3785, $columns['point_3dm']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_2d_nosrid', $columns); - $this->assertEquals('point_4d', strtolower($columns['point_4d']->getName())); - $this->assertInstanceOf(GeometryType::class, $columns['point_4d']->getType()); - $this->assertFalse($columns['point_4d']->getUnsigned()); - $this->assertTrue($columns['point_4d']->getNotnull()); - $this->assertNull($columns['point_4d']->getDefault()); - $this->assertIsArray($columns['point_4d']->getPlatformOptions()); - - $this->assertEquals('POINTZM', $columns['point_4d']->getPlatformOption('geometry_type')); - $this->assertEquals(3785, $columns['point_4d']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_2d_nullable', $columns); - $this->assertEquals('point_2d_nullable', strtolower($columns['point_2d_nullable']->getName())); - $this->assertInstanceOf(GeometryType::class, $columns['point_2d_nullable']->getType()); - $this->assertFalse($columns['point_2d_nullable']->getUnsigned()); - $this->assertFalse($columns['point_2d_nullable']->getNotnull()); - // $this->assertEquals('NULL::geometry', $columns['point_2d_nullable']->getDefault()); - $this->assertIsArray($columns['point_2d_nullable']->getPlatformOptions()); - - $this->assertEquals('POINT', $columns['point_2d_nullable']->getPlatformOption('geometry_type')); - $this->assertEquals(3785, $columns['point_2d_nullable']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_2d_nosrid', $columns); - $this->assertEquals('point_2d_nosrid', strtolower($columns['point_2d_nosrid']->getName())); - $this->assertInstanceOf(GeometryType::class, $columns['point_2d_nosrid']->getType()); - $this->assertFalse($columns['point_2d_nosrid']->getUnsigned()); - $this->assertTrue($columns['point_2d_nosrid']->getNotnull()); - $this->assertNull($columns['point_2d_nosrid']->getDefault()); - $this->assertIsArray($columns['point_2d_nosrid']->getPlatformOptions()); - - $this->assertEquals('POINT', $columns['point_2d_nosrid']->getPlatformOption('geometry_type')); - $this->assertEquals(0, $columns['point_2d_nosrid']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_geography_2d', $columns); - $this->assertEquals('point_geography_2d', strtolower($columns['point_geography_2d']->getName())); - $this->assertInstanceOf(GeographyType::class, $columns['point_geography_2d']->getType()); - $this->assertFalse($columns['point_geography_2d']->getUnsigned()); - $this->assertTrue($columns['point_geography_2d']->getNotnull()); - $this->assertNull($columns['point_geography_2d']->getDefault()); - $this->assertIsArray($columns['point_geography_2d']->getPlatformOptions()); - - $this->assertEquals('POINT', $columns['point_geography_2d']->getPlatformOption('geometry_type')); - $this->assertEquals(4326, $columns['point_geography_2d']->getPlatformOption('srid')); - - // --- - - $this->assertArrayHasKey('point_geography_2d_srid', $columns); - $this->assertEquals('point_geography_2d_srid', strtolower($columns['point_geography_2d_srid']->getName())); - $this->assertInstanceOf(GeographyType::class, $columns['point_geography_2d_srid']->getType()); - $this->assertFalse($columns['point_geography_2d_srid']->getUnsigned()); - $this->assertTrue($columns['point_geography_2d_srid']->getNotnull()); - $this->assertNull($columns['point_geography_2d_srid']->getDefault()); - $this->assertIsArray($columns['point_geography_2d_srid']->getPlatformOptions()); - - $this->assertEquals('POINT', $columns['point_geography_2d_srid']->getPlatformOption('geometry_type')); - $this->assertEquals(4326, $columns['point_geography_2d_srid']->getPlatformOption('srid')); - } - - public function testDiffListTableColumns(): void - { - $offlineTable = $this->createTableSchema(); - $onlineTable = $this->sm->listTableDetails('points'); - - $comparator = new Comparator(); - $diff = $comparator->diffTable($offlineTable, $onlineTable); - - $this->assertFalse($diff, 'No differences should be detected with the offline vs online schema.'); - } - - public function testListTableIndexes(): void - { - $indexes = $this->sm->listTableIndexes('points'); - - $spatialIndexes = [ - 'idx_27ba8e293be136c3', - 'idx_27ba8e295f51a43c', - 'idx_27ba8e295afbb72d', - 'idx_27ba8e29b7a5f324', - 'idx_27ba8e293c257075', - 'idx_27ba8e2999674a3d', - 'idx_27ba8e29cf3dedbb', - 'idx_27ba8e29cf3dedbb', - 'idx_27ba8e293d5fe69e', - 'idx_27ba8e29b832b304', - ]; - - $nonSpatialIndexes = [ - 'idx_text', - 'idx_text_gist', - ]; - - foreach ($spatialIndexes as $spatialIndex) { - $this->assertArrayHasKey($spatialIndex, $indexes); - $this->assertTrue($indexes[$spatialIndex]->hasFlag('spatial')); - } - - foreach ($nonSpatialIndexes as $nonSpatialIndex) { - $this->assertArrayHasKey($nonSpatialIndex, $indexes); - $this->assertFalse($indexes[$nonSpatialIndex]->hasFlag('spatial')); - } - } - - public function testGetCreateTableSql(): void - { - $table = $this->sm->listTableDetails('points'); - - $sql = $this->_getConnection()->getDatabasePlatform()->getCreateTableSQL($table); - - $expected = 'CREATE TABLE points (id INT NOT NULL, text TEXT NOT NULL, tsvector TEXT NOT NULL, geometry geometry(GEOMETRY, 0) NOT NULL, point geometry(POINT, 0) NOT NULL, point_2d geometry(POINT, 3785) NOT NULL, point_3dz geometry(POINTZ, 3785) NOT NULL, point_3dm geometry(POINTM, 3785) NOT NULL, point_4d geometry(POINTZM, 3785) NOT NULL, point_2d_nullable geometry(POINT, 3785) DEFAULT NULL, point_2d_nosrid geometry(POINT, 0) NOT NULL, geography geography(GEOMETRY, 4326) NOT NULL, point_geography_2d geography(POINT, 4326) NOT NULL, point_geography_2d_srid geography(POINT, 4326) NOT NULL, PRIMARY KEY(id))'; - $this->assertContains($expected, $sql); - - $this->assertContains("COMMENT ON TABLE points IS 'This is a comment for table points'", $sql); - $this->assertContains("COMMENT ON COLUMN points.point IS 'This is a comment for column point'", $sql); - - $spatialIndexes = [ - 'CREATE INDEX idx_27ba8e29b7a5f324 ON points USING gist(point)', - 'CREATE INDEX idx_27ba8e2999674a3d ON points USING gist(point_2d)', - 'CREATE INDEX idx_27ba8e293be136c3 ON points USING gist(point_3dz)', - 'CREATE INDEX idx_27ba8e29b832b304 ON points USING gist(point_3dm)', - 'CREATE INDEX idx_27ba8e29cf3dedbb ON points USING gist(point_4d)', - 'CREATE INDEX idx_27ba8e293c257075 ON points USING gist(point_2d_nullable)', - 'CREATE INDEX idx_27ba8e293d5fe69e ON points USING gist(point_2d_nosrid)', - 'CREATE INDEX idx_27ba8e295f51a43c ON points USING gist(point_geography_2d)', - 'CREATE INDEX idx_27ba8e295afbb72d ON points USING gist(point_geography_2d_srid)', - ]; - - foreach ($spatialIndexes as $spatialIndex) { - $this->assertContains($spatialIndex, $sql); - } - } - - public function testGetCreateTableSqlSkipsAlreadyAddedTable(): void - { - $schema = new Schema([], [], $this->sm->createSchemaConfig()); - - $this->_getMessengerConnection()->configureSchema($schema, $this->_getConnection(), static fn () => false); - - $sql = $this->_getConnection()->getDatabasePlatform()->getCreateTableSQL($schema->getTable('messenger_messages')); - - $expected = $sql[0]; - $this->assertStringStartsWith('CREATE TABLE messenger_messages', $expected); - - unset($sql[0]); - - // Assert that the CREATE TABLE statement for the messenger_messages - // table exists only once - $this->assertNotContains($expected, $sql); - } - - public function testGetDropTableSql(): void - { - $table = $this->sm->listTableDetails('points'); - - $sql = $this->_getConnection()->getDatabasePlatform()->getDropTableSQL($table); - - $this->assertEquals('DROP TABLE points', $sql); - } - - public function testAlterTableScenario(): void - { - $table = $this->sm->listTableDetails('points'); - - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedColumns['linestring'] = new Column('linestring', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $tableDiff->removedColumns['point'] = $table->getColumn('point'); - $tableDiff->changedColumns[] = new ColumnDiff('point_3dm', new Column('point_3dm', Type::getType('geometry'), ['platformOptions' => ['srid' => 4326]]), ['srid'], $table->getColumn('point_3dm')); - - $this->sm->alterTable($tableDiff); - - $table = $this->sm->listTableDetails('points'); - $this->assertFalse($table->hasColumn('point')); - $this->assertTrue($table->hasColumn('linestring')); - $this->assertEquals(4326, $table->getColumn('point_3dm')->getPlatformOption('srid')); - - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); - - $this->sm->alterTable($tableDiff); - - $table = $this->sm->listTableDetails('points'); - $this->assertTrue($table->hasIndex('linestring_idx')); - $this->assertEquals(['linestring'], array_map('strtolower', $table->getIndex('linestring_idx')->getColumns())); - $this->assertTrue($table->getIndex('linestring_idx')->hasFlag('spatial')); - $this->assertFalse($table->getIndex('linestring_idx')->isPrimary()); - $this->assertFalse($table->getIndex('linestring_idx')->isUnique()); - - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedIndexes[] = new Index('linestring_idx', ['linestring', 'point_2d'], false, false, ['spatial']); - - $this->sm->alterTable($tableDiff); - - $table = $this->sm->listTableDetails('points'); - $this->assertTrue($table->hasIndex('linestring_idx')); - $this->assertEquals(['linestring', 'point_2d'], array_map('strtolower', $table->getIndex('linestring_idx')->getColumns())); - - $tableDiff = new TableDiff('points'); - - $tableDiff->fromTable = $table; - $tableDiff->renamedIndexes['linestring_idx'] = new Index('linestring_renamed_idx', ['linestring', 'point_2d'], false, false, ['spatial']); - - $this->sm->alterTable($tableDiff); - - $table = $this->sm->listTableDetails('points'); - $this->assertTrue($table->hasIndex('linestring_renamed_idx')); - $this->assertFalse($table->hasIndex('linestring_idx')); - $this->assertEquals(['linestring', 'point_2d'], array_map('strtolower', $table->getIndex('linestring_renamed_idx')->getColumns())); - $this->assertFalse($table->getIndex('linestring_renamed_idx')->isPrimary()); - $this->assertFalse($table->getIndex('linestring_renamed_idx')->isUnique()); - } - - public function testAlterTableThrowsExceptionForChangedType(): void - { - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('The type of a spatial column cannot be changed (Requested changing type from "geometry" to "geography" for column "point_2d" in table "points")'); - - $table = $this->sm->listTableDetails('points'); - - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedColumns[] = new ColumnDiff('point_2d', new Column('point_2d', Type::getType('geography'), []), ['type'], $table->getColumn('point_2d')); - - $this->sm->alterTable($tableDiff); - } - - public function testAlterTableThrowsExceptionForChangedSpatialType(): void - { - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('The geometry_type of a spatial column cannot be changed (Requested changing type from "POINT" to "LINESTRING" for column "point_2d" in table "points")'); - - $table = $this->sm->listTableDetails('points'); - - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedColumns[] = new ColumnDiff('point_2d', new Column('point_2d', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'LINESTRING']]), ['geometry_type'], $table->getColumn('point_2d')); - - $this->sm->alterTable($tableDiff); - } -} diff --git a/tests/Event/ORMSchemaEventSubscriberTest.php b/tests/Event/ORMSchemaEventListenerTest.php similarity index 90% rename from tests/Event/ORMSchemaEventSubscriberTest.php rename to tests/Event/ORMSchemaEventListenerTest.php index e9b665ea..645bb091 100644 --- a/tests/Event/ORMSchemaEventSubscriberTest.php +++ b/tests/Event/ORMSchemaEventListenerTest.php @@ -9,9 +9,13 @@ use Jsor\Doctrine\PostGIS\Entity\ReservedWordsEntity; /** + * @covers \Jsor\Doctrine\PostGIS\Event\ORMSchemaEventListener + * * @group orm + * + * @internal */ -final class ORMSchemaEventSubscriberTest extends AbstractFunctionalTestCase +final class ORMSchemaEventListenerTest extends AbstractFunctionalTestCase { public function testEntity(): void { @@ -21,8 +25,8 @@ public function testEntity(): void $em = $this->_getEntityManager(); - $sm = $em->getConnection()->getSchemaManager(); - $table = $sm->listTableDetails('points'); + $sm = $em->getConnection()->createSchemaManager(); + $table = $sm->introspectTable('points'); $this->assertTrue($table->hasIndex('idx_point')); $this->assertTrue($table->getIndex('idx_point')->hasFlag('spatial')); diff --git a/tests/Schema/SchemaManagerFactoryTest.php b/tests/Schema/SchemaManagerFactoryTest.php new file mode 100644 index 00000000..7f6bd309 --- /dev/null +++ b/tests/Schema/SchemaManagerFactoryTest.php @@ -0,0 +1,34 @@ + getenv('DB_TYPE'), + 'user' => getenv('DB_USER'), + 'password' => getenv('DB_PASSWORD'), + 'host' => getenv('DB_HOST'), + 'dbname' => getenv('DB_NAME'), + 'port' => getenv('DB_PORT'), + ]; + + static::assertInstanceOf(SchemaManager::class, $factory->createSchemaManager(new Connection($params, new Driver()))); + } +} diff --git a/tests/Schema/SchemaManagerTest.php b/tests/Schema/SchemaManagerTest.php index b5e88e23..cf112475 100644 --- a/tests/Schema/SchemaManagerTest.php +++ b/tests/Schema/SchemaManagerTest.php @@ -4,8 +4,23 @@ namespace Jsor\Doctrine\PostGIS\Schema; +use Doctrine\DBAL\Schema\Column; +use Doctrine\DBAL\Schema\ColumnDiff; +use Doctrine\DBAL\Schema\Comparator; +use Doctrine\DBAL\Schema\Index; +use Doctrine\DBAL\Schema\Table; +use Doctrine\DBAL\Schema\TableDiff; +use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\AbstractFunctionalTestCase; +use Jsor\Doctrine\PostGIS\Types\GeographyType; +use Jsor\Doctrine\PostGIS\Types\GeometryType; +use RuntimeException; +/** + * @covers \Jsor\Doctrine\PostGIS\Schema\SchemaManager + * + * @internal + */ final class SchemaManagerTest extends AbstractFunctionalTestCase { protected function setUp(): void @@ -30,7 +45,7 @@ protected function tearDown(): void public function testListSpatialIndexes(): void { - $schemaManager = new SchemaManager($this->_getConnection()); + $schemaManager = $this->getSchemaManager(); $expected = [ 'idx_27ba8e29b7a5f324' => [ @@ -67,7 +82,7 @@ public function testListSpatialIndexes(): void public function testGetGeometrySpatialColumnInfo(): void { - $schemaManager = new SchemaManager($this->_getConnection()); + $schemaManager = $this->getSchemaManager(); $this->assertNull($schemaManager->getGeometrySpatialColumnInfo('foo.points', 'text')); @@ -122,7 +137,7 @@ public function testGetGeometrySpatialColumnInfo(): void public function testGetGeographySpatialColumnInfo(): void { - $schemaManager = new SchemaManager($this->_getConnection()); + $schemaManager = $this->getSchemaManager(); $this->assertNull($schemaManager->getGeographySpatialColumnInfo('foo.points', 'text')); @@ -147,7 +162,7 @@ public function testGetGeographySpatialColumnInfo(): void public function testGetGeometrySpatialColumnInfoWithReservedWords(): void { - $schemaManager = new SchemaManager($this->_getConnection()); + $schemaManager = $this->getSchemaManager(); $expected = [ 'type' => 'GEOMETRY', @@ -158,7 +173,7 @@ public function testGetGeometrySpatialColumnInfoWithReservedWords(): void public function testGetGeographySpatialColumnInfoWithReservedWords(): void { - $schemaManager = new SchemaManager($this->_getConnection()); + $schemaManager = $this->getSchemaManager(); $expected = [ 'type' => 'GEOMETRY', @@ -166,4 +181,390 @@ public function testGetGeographySpatialColumnInfoWithReservedWords(): void ]; $this->assertEquals($expected, $schemaManager->getGeographySpatialColumnInfo('"user"', '"primary"')); } + + public function testAlterTableThrowsExceptionForChangedType(): void + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('The type of a spatial column cannot be changed (Requested changing type from "geometry" to "geography" for column "point_2d" in table "points")'); + + $schemaManager = $this->getSchemaManager(); + $table = $schemaManager->introspectTable('points'); + + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->changedColumns[] = new ColumnDiff('point_2d', new Column('point_2d', Type::getType('geography'), []), ['type'], $table->getColumn('point_2d')); + + $schemaManager->alterTable($tableDiff); + } + + public function testAlterTableThrowsExceptionForChangedSpatialType(): void + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('The geometry_type of a spatial column cannot be changed (Requested changing type from "POINT" to "LINESTRING" for column "point_2d" in table "points")'); + + $schemaManager = $this->getSchemaManager(); + $table = $schemaManager->introspectTable('points'); + + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->changedColumns[] = new ColumnDiff('point_2d', new Column('point_2d', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'LINESTRING']]), ['geometry_type'], $table->getColumn('point_2d')); + + $schemaManager->alterTable($tableDiff); + } + + public function testListTableColumnsPoint(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point', $columns); + $this->assertEquals('point', strtolower($columns['point']->getName())); + $this->assertInstanceOf(GeometryType::class, $columns['point']->getType()); + $this->assertFalse($columns['point']->getUnsigned()); + $this->assertTrue($columns['point']->getNotnull()); + $this->assertNull($columns['point']->getDefault()); + $this->assertIsArray($columns['point']->getPlatformOptions()); + + $this->assertEquals('POINT', $columns['point']->getPlatformOption('geometry_type')); + $this->assertEquals(0, $columns['point']->getPlatformOption('srid')); + } + + public function testListTableColumnsPoint2d(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_2d', $columns); + $this->assertEquals('point_2d', strtolower($columns['point_2d']->getName())); + $this->assertInstanceOf(GeometryType::class, $columns['point_2d']->getType()); + $this->assertFalse($columns['point_2d']->getUnsigned()); + $this->assertTrue($columns['point_2d']->getNotnull()); + $this->assertNull($columns['point_2d']->getDefault()); + $this->assertIsArray($columns['point_2d']->getPlatformOptions()); + + $this->assertEquals('POINT', $columns['point_2d']->getPlatformOption('geometry_type')); + $this->assertEquals(3785, $columns['point_2d']->getPlatformOption('srid')); + } + + public function testListTableColumns3dz(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_3dz', $columns); + $this->assertEquals('point_3dz', strtolower($columns['point_3dz']->getName())); + $this->assertInstanceOf(GeometryType::class, $columns['point_3dz']->getType()); + $this->assertFalse($columns['point_3dz']->getUnsigned()); + $this->assertTrue($columns['point_3dz']->getNotnull()); + $this->assertNull($columns['point_3dz']->getDefault()); + $this->assertIsArray($columns['point_3dz']->getPlatformOptions()); + + $this->assertEquals('POINTZ', $columns['point_3dz']->getPlatformOption('geometry_type')); + $this->assertEquals(3785, $columns['point_3dz']->getPlatformOption('srid')); + } + + public function testListTableColumns3dm(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_3dm', $columns); + $this->assertEquals('point_3dm', strtolower($columns['point_3dm']->getName())); + $this->assertInstanceOf(GeometryType::class, $columns['point_3dm']->getType()); + $this->assertFalse($columns['point_3dm']->getUnsigned()); + $this->assertTrue($columns['point_3dm']->getNotnull()); + $this->assertNull($columns['point_3dm']->getDefault()); + $this->assertIsArray($columns['point_3dm']->getPlatformOptions()); + + $this->assertEquals('POINTM', $columns['point_3dm']->getPlatformOption('geometry_type')); + $this->assertEquals(3785, $columns['point_3dm']->getPlatformOption('srid')); + } + + public function testListTableColumns4D(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_2d_nosrid', $columns); + $this->assertEquals('point_4d', strtolower($columns['point_4d']->getName())); + $this->assertInstanceOf(GeometryType::class, $columns['point_4d']->getType()); + $this->assertFalse($columns['point_4d']->getUnsigned()); + $this->assertTrue($columns['point_4d']->getNotnull()); + $this->assertNull($columns['point_4d']->getDefault()); + $this->assertIsArray($columns['point_4d']->getPlatformOptions()); + + $this->assertEquals('POINTZM', $columns['point_4d']->getPlatformOption('geometry_type')); + $this->assertEquals(3785, $columns['point_4d']->getPlatformOption('srid')); + } + + public function testListTableColumns2dNullable(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_2d_nullable', $columns); + $this->assertEquals('point_2d_nullable', strtolower($columns['point_2d_nullable']->getName())); + $this->assertInstanceOf(GeometryType::class, $columns['point_2d_nullable']->getType()); + $this->assertFalse($columns['point_2d_nullable']->getUnsigned()); + $this->assertFalse($columns['point_2d_nullable']->getNotnull()); + // $this->assertEquals('NULL::geometry', $columns['point_2d_nullable']->getDefault()); + $this->assertIsArray($columns['point_2d_nullable']->getPlatformOptions()); + + $this->assertEquals('POINT', $columns['point_2d_nullable']->getPlatformOption('geometry_type')); + $this->assertEquals(3785, $columns['point_2d_nullable']->getPlatformOption('srid')); + } + + public function testListTableColumns2dNoSrid(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_2d_nosrid', $columns); + $this->assertEquals('point_2d_nosrid', strtolower($columns['point_2d_nosrid']->getName())); + $this->assertInstanceOf(GeometryType::class, $columns['point_2d_nosrid']->getType()); + $this->assertFalse($columns['point_2d_nosrid']->getUnsigned()); + $this->assertTrue($columns['point_2d_nosrid']->getNotnull()); + $this->assertNull($columns['point_2d_nosrid']->getDefault()); + $this->assertIsArray($columns['point_2d_nosrid']->getPlatformOptions()); + + $this->assertEquals('POINT', $columns['point_2d_nosrid']->getPlatformOption('geometry_type')); + $this->assertEquals(0, $columns['point_2d_nosrid']->getPlatformOption('srid')); + } + + public function testListTableColumnsGeography2d(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_geography_2d', $columns); + $this->assertEquals('point_geography_2d', strtolower($columns['point_geography_2d']->getName())); + $this->assertInstanceOf(GeographyType::class, $columns['point_geography_2d']->getType()); + $this->assertFalse($columns['point_geography_2d']->getUnsigned()); + $this->assertTrue($columns['point_geography_2d']->getNotnull()); + $this->assertNull($columns['point_geography_2d']->getDefault()); + $this->assertIsArray($columns['point_geography_2d']->getPlatformOptions()); + + $this->assertEquals('POINT', $columns['point_geography_2d']->getPlatformOption('geometry_type')); + $this->assertEquals(4326, $columns['point_geography_2d']->getPlatformOption('srid')); + } + + public function testListTableColumnsGeography2dSrid(): void + { + $columns = $this->getSchemaManager()->listTableColumns('points'); + + $this->assertArrayHasKey('point_geography_2d_srid', $columns); + $this->assertEquals('point_geography_2d_srid', strtolower($columns['point_geography_2d_srid']->getName())); + $this->assertInstanceOf(GeographyType::class, $columns['point_geography_2d_srid']->getType()); + $this->assertFalse($columns['point_geography_2d_srid']->getUnsigned()); + $this->assertTrue($columns['point_geography_2d_srid']->getNotnull()); + $this->assertNull($columns['point_geography_2d_srid']->getDefault()); + $this->assertIsArray($columns['point_geography_2d_srid']->getPlatformOptions()); + + $this->assertEquals('POINT', $columns['point_geography_2d_srid']->getPlatformOption('geometry_type')); + $this->assertEquals(4326, $columns['point_geography_2d_srid']->getPlatformOption('srid')); + } + + public function testDiffListTableColumns(): void + { + $offlineTable = $this->createTableSchema(); + $onlineTable = $this->getSchemaManager()->introspectTable('points'); + + $comparator = new Comparator(); + $diff = $comparator->compareTables($offlineTable, $onlineTable); + + $this->assertEmpty($diff->getAddedColumns(), 'No differences should be detected with the offline vs online schema.'); + $this->assertEmpty($diff->getAddedForeignKeys(), 'No differences should be detected with the offline vs online schema.'); + $this->assertEmpty($diff->getAddedIndexes(), 'No differences should be detected with the offline vs online schema.'); + + $this->assertEmpty($diff->getRenamedColumns(), 'No differences should be detected with the offline vs online schema.'); + $this->assertEmpty($diff->getRenamedIndexes(), 'No differences should be detected with the offline vs online schema.'); + + $this->assertEmpty($diff->getModifiedColumns(), 'No differences should be detected with the offline vs online schema.'); + $this->assertEmpty($diff->getModifiedForeignKeys(), 'No differences should be detected with the offline vs online schema.'); + $this->assertEmpty($diff->getModifiedIndexes(), 'No differences should be detected with the offline vs online schema.'); + + $this->assertEmpty($diff->getDroppedColumns(), 'No differences should be detected with the offline vs online schema.'); + $this->assertEmpty($diff->getDroppedForeignKeys(), 'No differences should be detected with the offline vs online schema.'); + $this->assertEmpty($diff->getDroppedIndexes(), 'No differences should be detected with the offline vs online schema.'); + } + + public function testListTableIndexes(): void + { + $indexes = $this->getSchemaManager()->listTableIndexes('points'); + + $spatialIndexes = [ + 'idx_27ba8e293be136c3', + 'idx_27ba8e295f51a43c', + 'idx_27ba8e295afbb72d', + 'idx_27ba8e29b7a5f324', + 'idx_27ba8e293c257075', + 'idx_27ba8e2999674a3d', + 'idx_27ba8e29cf3dedbb', + 'idx_27ba8e29cf3dedbb', + 'idx_27ba8e293d5fe69e', + 'idx_27ba8e29b832b304', + ]; + + $nonSpatialIndexes = [ + 'idx_text', + 'idx_text_gist', + ]; + + foreach ($spatialIndexes as $spatialIndex) { + $this->assertArrayHasKey($spatialIndex, $indexes); + $this->assertTrue($indexes[$spatialIndex]->hasFlag('spatial')); + } + + foreach ($nonSpatialIndexes as $nonSpatialIndex) { + $this->assertArrayHasKey($nonSpatialIndex, $indexes); + $this->assertFalse($indexes[$nonSpatialIndex]->hasFlag('spatial')); + } + } + + private function createTableSchema(): Table + { + $table = new Table('points'); + $table->addColumn('id', 'integer', ['notnull' => true]); + $table->addColumn('text', 'text', ['notnull' => true]); + $table->addColumn('tsvector', 'tsvector', ['notnull' => true]); + + $table->addColumn('geometry', 'geometry', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'GEOMETRY', + 'srid' => 0, + ]); + + $table->addColumn('point', 'geometry', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINT', + 'srid' => 0, + ]) + ->setComment('This is a comment for column point'); + + $table->addColumn('point_2d', 'geometry', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINT', + 'srid' => 3785, + ]); + + $table->addColumn('point_3dz', 'geometry', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINTZ', + 'srid' => 3785, + ]); + + $table->addColumn('point_3dm', 'geometry', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINTM', + 'srid' => 3785, + ]); + + $table->addColumn('point_4d', 'geometry', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINTZM', + 'srid' => 3785, + ]); + + $table->addColumn('point_2d_nullable', 'geometry', ['notnull' => false]) + ->setPlatformOptions([ + 'geometry_type' => 'POINT', + 'srid' => 3785, + ]); + + $table->addColumn('point_2d_nosrid', 'geometry', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINT', + 'srid' => 0, + ]); + + $table->addColumn('geography', 'geography', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'GEOMETRY', + 'srid' => 4326, + ]); + + $table->addColumn('point_geography_2d', 'geography', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINT', + 'srid' => 4326, + ]); + + $table->addColumn('point_geography_2d_srid', 'geography', ['notnull' => true]) + ->setPlatformOptions([ + 'geometry_type' => 'POINT', + 'srid' => 4326, + ]); + + $table->addIndex(['text'], 'idx_text'); + $table->addIndex(['tsvector'], 'idx_text_gist'); + + $table->addIndex(['point'], null, ['spatial']); + $table->addIndex(['point_2d'], null, ['spatial']); + $table->addIndex(['point_3dz'], null, ['spatial']); + $table->addIndex(['point_3dm'], null, ['spatial']); + $table->addIndex(['point_4d'], null, ['spatial']); + $table->addIndex(['point_2d_nullable'], null, ['spatial']); + $table->addIndex(['point_2d_nosrid'], null, ['spatial']); + $table->addIndex(['point_geography_2d'], null, ['spatial']); + $table->addIndex(['point_geography_2d_srid'], null, ['spatial']); + + $table->setComment('This is a comment for table points'); + + $table->setPrimaryKey(['id']); + + return $table; + } + + public function testAlterTableScenario(): void + { + $schemaManager = $this->getSchemaManager(); + $table = $schemaManager->introspectTable('points'); + + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->addedColumns['linestring'] = (new Column('linestring', Type::getType('geometry')))->setPlatformOptions(['geometry_type' => 'linestring', 'srid' => 3785]); + $tableDiff->removedColumns['point'] = $table->getColumn('point'); + $tableDiff->changedColumns[] = new ColumnDiff('point_3dm', (new Column('point_3dm', Type::getType('geometry')))->setPlatformOption('srid', 4326), ['srid'], $table->getColumn('point_3dm')); + + $schemaManager->alterTable($tableDiff); + + $table = $schemaManager->introspectTable('points'); + $this->assertFalse($table->hasColumn('point')); + $this->assertTrue($table->hasColumn('linestring')); + $this->assertEquals(4326, $table->getColumn('point_3dm')->getPlatformOption('srid')); + + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); + + $schemaManager->alterTable($tableDiff); + + $table = $schemaManager->introspectTable('points'); + $this->assertTrue($table->hasIndex('linestring_idx')); + $this->assertEquals(['linestring'], array_map('strtolower', $table->getIndex('linestring_idx')->getColumns())); + $this->assertTrue($table->getIndex('linestring_idx')->hasFlag('spatial')); + $this->assertFalse($table->getIndex('linestring_idx')->isPrimary()); + $this->assertFalse($table->getIndex('linestring_idx')->isUnique()); + + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->changedIndexes[] = new Index('linestring_idx', ['linestring', 'point_2d'], false, false, ['spatial']); + + $schemaManager->alterTable($tableDiff); + + $table = $schemaManager->introspectTable('points'); + $this->assertTrue($table->hasIndex('linestring_idx')); + $this->assertEquals(['linestring', 'point_2d'], array_map('strtolower', $table->getIndex('linestring_idx')->getColumns())); + + $tableDiff = new TableDiff('points'); + + $tableDiff->fromTable = $table; + $tableDiff->renamedIndexes['linestring_idx'] = new Index('linestring_renamed_idx', ['linestring', 'point_2d'], false, false, ['spatial']); + + $schemaManager->alterTable($tableDiff); + + $table = $schemaManager->introspectTable('points'); + $this->assertTrue($table->hasIndex('linestring_renamed_idx')); + $this->assertFalse($table->hasIndex('linestring_idx')); + $this->assertEquals(['linestring', 'point_2d'], array_map('strtolower', $table->getIndex('linestring_renamed_idx')->getColumns())); + $this->assertFalse($table->getIndex('linestring_renamed_idx')->isPrimary()); + $this->assertFalse($table->getIndex('linestring_renamed_idx')->isUnique()); + } + + private function getSchemaManager(): SchemaManager + { + return new SchemaManager($this->_getConnection(), $this->_getConnection()->getDatabasePlatform()); + } } diff --git a/tests/Schema/SpatialIndexSqlGeneratorTest.php b/tests/Schema/SpatialIndexSqlGeneratorTest.php new file mode 100644 index 00000000..f0d4cf45 --- /dev/null +++ b/tests/Schema/SpatialIndexSqlGeneratorTest.php @@ -0,0 +1,61 @@ +addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + yield 'Spatial index' => [ + new Index('linestring_idx', ['linestring'], false, false, ['spatial']), + $table, + 'CREATE INDEX linestring_idx ON points USING gist(linestring)', + ]; + + yield 'Primary index' => [ + new Index('linestring_idx', ['linestring'], false, true, ['spatial']), + $table, + 'ALTER TABLE points ADD PRIMARY KEY (linestring)', + ]; + } + + /** @dataProvider providerGetSql */ + public function testGetSql(Index $index, Table|Identifier $table, string $expected): void + { + $generator = new SpatialIndexSqlGenerator(new PostGISPlatform()); + + static::assertSame($expected, $generator->getSql($index, $table)); + } + + public function testGetSqlThrowExceptionEmptyColumns(): void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("Incomplete definition. 'columns' required"); + + $generator = new SpatialIndexSqlGenerator(new PostGISPlatform()); + $table = new Table('points'); + $table->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $index = new Index('linestring_idx', [], false, false, ['spatial']); + + $generator->getSql($index, $table); + } +} diff --git a/tests/Schema/SpatialIndexesTest.php b/tests/Schema/SpatialIndexesTest.php new file mode 100644 index 00000000..5545496f --- /dev/null +++ b/tests/Schema/SpatialIndexesTest.php @@ -0,0 +1,131 @@ +addColumn('name', 'string', ['length' => 42]); + $baseTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + $baseTable->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + + $table = clone $baseTable; + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->addedIndexes[] = new Index('name_idx', ['name']); + $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); + + yield 'Added spatial' => [$tableDiff, 1, 0]; + + $table = clone $baseTable; + $table->addIndex(['name'], 'name_idx', []); + $table->addIndex(['point'], 'point_idx', []); + + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->changedIndexes[] = new Index('name_idx', ['name']); + $tableDiff->changedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); + + yield 'Changed spatial' => [$tableDiff, 0, 1]; + } + + /** @dataProvider providerFilterTableDiff */ + public function testFilterTableDiff(TableDiff $tableDiff, int $addedIndexes, int $changedIndexes): void + { + SpatialIndexes::filterTableDiff($tableDiff); + + static::assertCount($addedIndexes, $tableDiff->addedIndexes); + static::assertCount($changedIndexes, $tableDiff->changedIndexes); + } + + public function providerEnsureTableFlag(): iterable + { + $baseTable = new Table('points'); + $baseTable->addColumn('name', 'string', ['length' => 42]); + $baseTable->addIndex(['name'], 'name_idx', []); + $baseTable->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + + $table = clone $baseTable; + $table->addIndex(['linestring'], 'linestring_idx', ['spatial']); + + yield 'With spatial flag' => [$table]; + + $table = clone $baseTable; + $table->addIndex(['linestring'], 'linestring_idx', []); + + yield 'Without spatial flag' => [$table]; + } + + /** @dataProvider providerEnsureTableFlag */ + public function testEnsureTableFlag(Table $table): void + { + $spatialIndexes = SpatialIndexes::ensureTableFlag($table); + + static::assertCount(1, $spatialIndexes); + static::assertSame('linestring_idx', $spatialIndexes[0]->getName()); + static::assertTrue($spatialIndexes[0]->hasFlag('spatial')); + } + + public function providerEnsureTableDiffs(): iterable + { + static::_registerTypes(); + + $table = new Table('points'); + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->addedColumns[] = (new Column('linestring', Type::getType('geometry')))->setPlatformOptions(['geometry_type' => 'linestring', 'srid' => 3785]); + $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, []); + + yield 'Added column and index' => [0, $tableDiff]; + + $table = new Table('points'); + $table->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $table->addIndex(['linestring'], 'linestring_idx', []); + $tableDiff = new TableDiff('points'); + $tableDiff->fromTable = $table; + $tableDiff->changedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); + + yield 'Changed index' => [1, $tableDiff]; + + $tableDiff = new TableDiff('points'); + $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); + $tableDiff->changedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); + + yield 'Empty fromTable is skipped' => [0, $tableDiff]; + } + + /** @dataProvider providerEnsureTableDiffs */ + public function testEnsureTableDiffFlag(int $expected, TableDiff $tableDiff): void + { + $spatialIndexes = SpatialIndexes::ensureTableDiffFlag($tableDiff); + + static::assertCount($expected, $spatialIndexes); + + foreach ($spatialIndexes as $spatialIndex) { + static::assertTrue($spatialIndex->hasFlag('spatial')); + } + } +} diff --git a/tests/Types/AbstractTypeTestCase.php b/tests/Types/AbstractTypeTestCase.php index a42df0aa..3d5fc5d9 100644 --- a/tests/Types/AbstractTypeTestCase.php +++ b/tests/Types/AbstractTypeTestCase.php @@ -13,7 +13,7 @@ abstract class AbstractTypeTestCase extends AbstractTestCase protected function setUp(): void { - $this->_registerTypes(); + static::_registerTypes(); $this->type = Type::getType($this->getTypeName()); } diff --git a/tests/fixtures/Types/GeoJsonType.php b/tests/fixtures/Types/GeoJsonType.php new file mode 100644 index 00000000..845acaf9 --- /dev/null +++ b/tests/fixtures/Types/GeoJsonType.php @@ -0,0 +1,59 @@ +getNormalizedPostGISColumnOptions($column); + + return sprintf( + '%s(%s, %d)', + $this->getName(), + $options['geometry_type'], + $options['srid'] + ); + } + + public function requiresSQLCommentHint(AbstractPlatform $platform): bool + { + return true; + } +} From 73b7f7aee4b4a917b44d66f35b226c545d996832 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 18:35:32 +0200 Subject: [PATCH 07/19] Update docs --- README.md | 28 +++++++++++++++++++++------- docs/symfony.md | 22 ++++++++++------------ 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c7fd6415..a9d05488 100644 --- a/README.md +++ b/README.md @@ -47,23 +47,37 @@ for all available versions. Setup -- -To use the library with the Doctrine ORM, register the -`ORMSchemaEventSubscriber` event subscriber. +Basic setup requires registering Middleware and the SchemaManagerFactory via the +DBAL connection configuration. ```php +use Doctrine\DBAL\Configuration; +use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Driver\PgSQL\Driver; +use Jsor\Doctrine\PostGIS\Driver\Middleware; use Jsor\Doctrine\PostGIS\Event\ORMSchemaEventSubscriber; +use Jsor\Doctrine\PostGIS\Schema\SchemaManagerFactory; -$entityManager->getEventManager()->addEventSubscriber(new ORMSchemaEventSubscriber()); +$params = [ + // your connection parameters … +]; +$config = new Configuration(); +$config->setMiddlewares([new Middleware]); +$config->setSchemaManagerFactory(new SchemaManagerFactory()); + +$connection = new Connection($params, new Driver(), $config); ``` -To use it with the DBAL only, register the `DBALSchemaEventSubscriber` event -subscriber. + +Additionally, to also use the library with the Doctrine ORM, register the +`ORMSchemaEventListener` event subscriber. ```php -use Jsor\Doctrine\PostGIS\Event\DBALSchemaEventSubscriber; +use Jsor\Doctrine\PostGIS\Event\ORMSchemaEventListener; -$connection->getEventManager()->addEventSubscriber(new DBALSchemaEventSubscriber()); +$entityManager->getEventManager()->addEventSubscriber(new ORMSchemaEventSubscriber()); ``` + ### Symfony For integrating this library into a Symfony project, read the dedicated diff --git a/docs/symfony.md b/docs/symfony.md index 0ddd8e90..cc04461e 100644 --- a/docs/symfony.md +++ b/docs/symfony.md @@ -13,23 +13,21 @@ Setup To use the library with the Doctrine ORM (version 2.9 or higher is supported), register a [Doctrine event subscriber](https://symfony.com/doc/current/doctrine/event_listeners_subscribers.html) -in `config/services.yml`. +in `config/packages/jsor_doctrine_postgis.yaml`. ```yaml services: - Jsor\Doctrine\PostGIS\Event\ORMSchemaEventSubscriber: - tags: - - { name: doctrine.event_subscriber, connection: default } -``` + Jsor\Doctrine\PostGIS\Schema\SchemaManagerFactory: -The library can also be used with DBAL only (versions 2.13 or higher and 3.1 or -higher are supported). + Jsor\Doctrine\PostGIS\Event\ORMSchemaEventListener: + tags: [{ name: doctrine.event_listener, event: postGenerateSchemaTable, connection: default }] -```yaml -services: - Jsor\Doctrine\PostGIS\Event\DBALSchemaEventSubscriber: - tags: - - { name: doctrine.event_subscriber, connection: default } + Jsor\Doctrine\PostGIS\Driver\Middleware: + tags: [ doctrine.middleware ] + +doctrine: + dbal: + schema_manager_factory: Jsor\Doctrine\PostGIS\Schema\SchemaManagerFactory ``` ### Database Types From e795067e1d0f698d63a8494cdd4cb017c32381e2 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Thu, 7 Mar 2024 17:05:39 +0100 Subject: [PATCH 08/19] Updates for DBAL v4 deprecations --- src/Driver/Driver.php | 16 +++- src/Driver/PostGISPlatform.php | 57 ++++++-------- src/Schema/SchemaManager.php | 55 +++++++++---- src/Schema/SpatialIndexes.php | 110 +++++++++++++++++++------- src/Types/PostGISType.php | 11 ++- src/Utils/Doctrine.php | 15 ++++ tests/AbstractTestCase.php | 8 +- tests/Driver/DriverTest.php | 12 +-- tests/Driver/PostGISPlatformTest.php | 87 ++++++++++----------- tests/Schema/SchemaManagerTest.php | 76 +++++++++++------- tests/Schema/SpatialIndexesTest.php | 112 +++++++++++++++------------ tests/fixtures/Types/GeoJsonType.php | 2 +- tests/fixtures/points_drop.sql | 2 +- 13 files changed, 341 insertions(+), 222 deletions(-) create mode 100644 src/Utils/Doctrine.php diff --git a/src/Driver/Driver.php b/src/Driver/Driver.php index e7ba3843..4c9594f2 100644 --- a/src/Driver/Driver.php +++ b/src/Driver/Driver.php @@ -5,13 +5,17 @@ namespace Jsor\Doctrine\PostGIS\Driver; use Doctrine\DBAL; +use Doctrine\DBAL\Connection\StaticServerVersionProvider; use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver; use Doctrine\DBAL\Driver\API\ExceptionConverter; use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; +use Doctrine\DBAL\ServerVersionProvider; use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\Types\GeographyType; use Jsor\Doctrine\PostGIS\Types\GeometryType; use Jsor\Doctrine\PostGIS\Types\PostGISType; +use Jsor\Doctrine\PostGIS\Utils\Doctrine; final class Driver extends AbstractPostgreSQLDriver { @@ -36,14 +40,22 @@ public function connect(array $params): DBAL\Driver\Connection return $connection; } - public function getDatabasePlatform(): AbstractPlatform + public function getDatabasePlatform(?ServerVersionProvider $versionProvider = null): PostgreSQLPlatform { return new PostGISPlatform(); } + /** + * @param string $version + */ public function createDatabasePlatformForVersion($version): AbstractPlatform { - return $this->getDatabasePlatform(); + // Remove when DBAL v3 support is dropped. + if (Doctrine::isV3()) { + return $this->getDatabasePlatform(); + } + + return $this->getDatabasePlatform(new StaticServerVersionProvider($version)); } public function getExceptionConverter(): ExceptionConverter diff --git a/src/Driver/PostGISPlatform.php b/src/Driver/PostGISPlatform.php index 21cb8402..c417b03f 100644 --- a/src/Driver/PostGISPlatform.php +++ b/src/Driver/PostGISPlatform.php @@ -7,7 +7,6 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\ColumnDiff; -use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; use Doctrine\DBAL\Schema\SchemaDiff; use Doctrine\DBAL\Schema\Table; @@ -28,31 +27,21 @@ public function createSchemaManager(Connection $connection): PostgreSQLSchemaMan public function getAlterSchemaSQL(SchemaDiff $diff): array { - $spatialIndexes = []; + $sql = parent::getAlterSchemaSQL(SpatialIndexes::filterSchemaDiff($diff)); + + $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); + foreach ($diff->getAlteredTables() as $tableDiff) { $table = $tableDiff->getOldTable(); - if (!$table) { - continue; - } - /** @var Index[] $indices */ - $indices = []; - foreach (SpatialIndexes::ensureTableDiffFlag($tableDiff) as $index) { - $indices[] = $index; - } - $spatialIndexes[$table->getName()] = ['table' => $table, 'indexes' => $indices]; - - SpatialIndexes::filterTableDiff($tableDiff); - } + SpatialIndexes::ensureSpatialIndexFlags($tableDiff); - $sql = parent::getAlterSchemaSQL($diff); + foreach (SpatialIndexes::extractSpatialIndicies($tableDiff->getAddedIndexes()) as $index) { + $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); + } - $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); - foreach ($spatialIndexes as $spatialIndex) { - /** @var Table $table */ - $table = $spatialIndex['table']; - /** @var Index $index */ - foreach ($spatialIndex['indexes'] as $index) { + foreach (SpatialIndexes::extractSpatialIndicies($tableDiff->getModifiedIndexes()) as $index) { + $sql[] = $this->getDropIndexSQL($index->getName(), $table->getName()); $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); } } @@ -62,8 +51,9 @@ public function getAlterSchemaSQL(SchemaDiff $diff): array public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES): array { - $spatialIndexes = SpatialIndexes::ensureTableFlag($table); + SpatialIndexes::ensureSpatialIndexFlags($table); + $spatialIndexes = SpatialIndexes::extractSpatialIndicies($table->getIndexes()); foreach ($spatialIndexes as $index) { $table->dropIndex($index->getName()); } @@ -85,8 +75,9 @@ public function getCreateTablesSQL(array $tables): array /** @var Table $table */ foreach ($tables as $table) { - $spatialIndexes = SpatialIndexes::ensureTableFlag($table); + SpatialIndexes::ensureSpatialIndexFlags($table); + $spatialIndexes = SpatialIndexes::extractSpatialIndicies($table->getIndexes()); foreach ($spatialIndexes as $index) { $table->dropIndex($index->getName()); } @@ -116,28 +107,24 @@ public function getCreateTablesSQL(array $tables): array public function getAlterTableSQL(TableDiff $diff): array { $table = $diff->getOldTable(); - $spatialIndexes = []; $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); - if ($table) { - $spatialIndexes = SpatialIndexes::ensureTableDiffFlag($diff); - } - - SpatialIndexes::filterTableDiff($diff); + SpatialIndexes::ensureSpatialIndexFlags($diff); - $sql = parent::getAlterTableSQL($diff); + $sql = parent::getAlterTableSQL(SpatialIndexes::filterTableDiff($diff)); - if (!$table) { - return $sql; + foreach (SpatialIndexes::extractSpatialIndicies($diff->getAddedIndexes()) as $spatialIndex) { + $sql[] = $spatialIndexSqlGenerator->getSql($spatialIndex, $table); } - foreach ($spatialIndexes as $spatialIndex) { - $sql[] = $spatialIndexSqlGenerator->getSql($spatialIndex, $table); + foreach (SpatialIndexes::extractSpatialIndicies($diff->getModifiedIndexes()) as $index) { + $sql[] = $this->getDropIndexSQL($index->getName(), $table->getName()); + $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); } /** @var ColumnDiff $columnDiff */ foreach ($diff->getModifiedColumns() as $columnDiff) { - if ($columnDiff->hasChanged('srid')) { + if ($columnDiff->getOldColumn()->getPlatformOption('srid') !== $columnDiff->getNewColumn()->getPlatformOption('srid')) { $sql[] = sprintf( "SELECT UpdateGeometrySRID('%s', '%s', %d)", $table->getName(), diff --git a/src/Schema/SchemaManager.php b/src/Schema/SchemaManager.php index 0369a18c..38b5d035 100644 --- a/src/Schema/SchemaManager.php +++ b/src/Schema/SchemaManager.php @@ -4,10 +4,13 @@ namespace Jsor\Doctrine\PostGIS\Schema; +use Doctrine\DBAL\Connection; use Doctrine\DBAL\Schema\Column; +use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; +use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\Types\GeographyType; use Jsor\Doctrine\PostGIS\Types\GeometryType; use Jsor\Doctrine\PostGIS\Types\PostGISType; @@ -18,9 +21,6 @@ final class SchemaManager extends PostgreSQLSchemaManager public function alterTable(TableDiff $tableDiff): void { $oldTable = $tableDiff->getOldTable(); - if (!$oldTable) { - return; - } foreach ($tableDiff->getModifiedColumns() as $columnDiff) { if (!$columnDiff->getNewColumn()->getType() instanceof PostGISType) { @@ -31,11 +31,16 @@ public function alterTable(TableDiff $tableDiff): void $oldColumn = $columnDiff->getOldColumn(); if ($columnDiff->hasTypeChanged()) { - throw new RuntimeException('The type of a spatial column cannot be changed (Requested changing type from "' . ($oldColumn?->getType()?->getName() ?? 'N/A') . '" to "' . $newColumn->getType()->getName() . '" for column "' . $newColumn->getName() . '" in table "' . $oldTable->getName() . '")'); + $oldType = Type::lookupName($oldColumn->getType()); + $newType = Type::lookupName($newColumn->getType()); + + throw new RuntimeException('The type of a spatial column cannot be changed (Requested changing type from "' . $oldType . '" to "' . $newType . '" for column "' . $newColumn->getName() . '" in table "' . $oldTable->getName() . '")'); } - if ($columnDiff->hasChanged('geometry_type')) { - throw new RuntimeException('The geometry_type of a spatial column cannot be changed (Requested changing type from "' . strtoupper((string) ($oldColumn?->getPlatformOption('geometry_type') ?? 'N/A')) . '" to "' . strtoupper((string) $newColumn->getPlatformOption('geometry_type')) . '" for column "' . $newColumn->getName() . '" in table "' . $oldTable->getName() . '")'); + $oldGT = (string) ($oldColumn->hasPlatformOption('geometry_type') ? $oldColumn->getPlatformOption('geometry_type') : 'N/A'); + $newGT = (string) ($newColumn->hasPlatformOption('geometry_type') ? $newColumn->getPlatformOption('geometry_type') : 'N/A'); + if (strtolower($oldGT) !== strtolower($newGT)) { + throw new RuntimeException('The geometry_type of a spatial column cannot be changed (Requested changing type from "' . strtoupper($oldGT) . '" to "' . strtoupper($newGT) . '" for column "' . $newColumn->getName() . '" in table "' . $oldTable->getName() . '")'); } } @@ -46,11 +51,16 @@ public function introspectTable(string $name): Table { $table = parent::introspectTable($name); - SpatialIndexes::ensureTableFlag($table); + SpatialIndexes::ensureSpatialIndexFlags($table); return $table; } + /** + * @param string $table + * + * @return array + */ public function listTableIndexes($table): array { $indexes = parent::listTableIndexes($table); @@ -85,7 +95,7 @@ public function listSpatialIndexes(string $table): array ORDER BY i.relname"; /** @var array $tableIndexes */ - $tableIndexes = $this->_conn->fetchAllAssociative( + $tableIndexes = $this->getConnection()->fetchAllAssociative( $sql, [ $this->trimQuotes($table), @@ -104,7 +114,7 @@ public function listSpatialIndexes(string $table): array AND a.attnum IN (" . implode(',', explode(' ', $row['indkey'])) . ') AND a.atttypid = t.oid'; - $stmt = $this->_conn->executeQuery($sql); + $stmt = $this->getConnection()->executeQuery($sql); /** @var array $indexColumns */ $indexColumns = $stmt->fetchAllAssociative(); @@ -138,7 +148,7 @@ public function getGeometrySpatialColumnInfo(string $table, string $column): ?ar AND f_geometry_column = ?'; /** @var array{coord_dimension: string, srid: string|int|null, type: string}|null $row */ - $row = $this->_conn->fetchAssociative( + $row = $this->getConnection()->fetchAssociative( $sql, [ $this->trimQuotes($table), @@ -165,7 +175,7 @@ public function getGeographySpatialColumnInfo(string $table, string $column): ?a AND f_geography_column = ?'; /** @var array{coord_dimension: string, srid: string|int|null, type: string}|null $row */ - $row = $this->_conn->fetchAssociative( + $row = $this->getConnection()->fetchAssociative( $sql, [ $this->trimQuotes($table), @@ -180,6 +190,13 @@ public function getGeographySpatialColumnInfo(string $table, string $column): ?a return $this->buildSpatialColumnInfo($row); } + /** + * @param string $table + * @param string $database + * @param array> $tableColumns + * + * @return array + */ protected function _getPortableTableColumnList($table, $database, $tableColumns): array { $columns = parent::_getPortableTableColumnList($table, $database, $tableColumns); @@ -195,7 +212,7 @@ protected function _getPortableTableColumnDefinition($tableColumn): Column { $column = parent::_getPortableTableColumnDefinition($tableColumn); - if ($tableColumn['table_name'] ?? false) { + if (isset($tableColumn['table_name'])) { $this->resolveSpatialColumnInfo($column, (string) $tableColumn['table_name']); } @@ -214,7 +231,7 @@ protected function resolveSpatialColumnInfo(Column $column, string $tableName): default => null, }; - if (!$info) { + if ($info === null) { return; } @@ -225,7 +242,7 @@ protected function resolveSpatialColumnInfo(Column $column, string $tableName): } $column - ->setType(PostGISType::getType($column->getType()->getName())) + ->setType(PostGISType::getType(Type::lookupName($column->getType()))) ->setDefault($default) ->setPlatformOption('geometry_type', $info['type']) ->setPlatformOption('srid', $info['srid']) @@ -263,4 +280,14 @@ private function trimQuotes(string $identifier): string { return str_replace(['`', '"', '[', ']'], '', $identifier); } + + private function getConnection(): Connection + { + // DBAL v3 + if (property_exists($this, '_conn')) { + return $this->_conn; + } + + return $this->connection; + } } diff --git a/src/Schema/SpatialIndexes.php b/src/Schema/SpatialIndexes.php index 0d998d38..97ceaa0f 100644 --- a/src/Schema/SpatialIndexes.php +++ b/src/Schema/SpatialIndexes.php @@ -5,62 +5,116 @@ namespace Jsor\Doctrine\PostGIS\Schema; use Doctrine\DBAL\Schema\Index; +use Doctrine\DBAL\Schema\SchemaDiff; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; use Jsor\Doctrine\PostGIS\Types\PostGISType; +use Jsor\Doctrine\PostGIS\Utils\Doctrine; final class SpatialIndexes { /** - * Filter spatial indexes from a TableDiff to prevent duplicate index SQL generation. + * @return Index[] the spacial indicies */ - public static function filterTableDiff(TableDiff $tableDiff): void + public static function extractSpatialIndicies(array $indicies): array { - $tableDiff->addedIndexes = array_filter($tableDiff->addedIndexes, static fn (Index $idx) => !$idx->hasFlag('spatial')); + return array_filter($indicies, static fn (Index $idx) => $idx->hasFlag('spatial')); + } - $changedIndexes = []; - /** @var Index $index */ - foreach ($tableDiff->changedIndexes as $index) { - if ($index->hasFlag('spatial')) { - $tableDiff->removedIndexes[] = $index; - } else { - $changedIndexes[] = $index; - } + public static function filterSchemaDiff(SchemaDiff $schemaDiff): SchemaDiff + { + $filter = static fn (TableDiff $diff): TableDiff => self::filterTableDiff($diff); + + if (Doctrine::isV3()) { + return new SchemaDiff( + $schemaDiff->getCreatedTables(), + array_map($filter, $schemaDiff->getAlteredTables()), + $schemaDiff->getDroppedTables(), + $schemaDiff->fromSchema, + $schemaDiff->getCreatedSchemas(), + $schemaDiff->getDroppedSchemas(), + $schemaDiff->getCreatedSequences(), + $schemaDiff->getAlteredSequences(), + $schemaDiff->getDroppedSequences(), + ); } - $tableDiff->changedIndexes = $changedIndexes; + + return new SchemaDiff( + $schemaDiff->getCreatedSchemas(), + $schemaDiff->getDroppedSchemas(), + $schemaDiff->getCreatedTables(), + array_map($filter, $schemaDiff->getAlteredTables()), + $schemaDiff->getDroppedTables(), + $schemaDiff->getCreatedSequences(), + $schemaDiff->getAlteredSequences(), + $schemaDiff->getDroppedSequences(), + ); } /** - * Ensure the 'spatial' flag is set on PostGIS columns in a Table. - * - * @return Index[] the spacial indicies + * Filter spatial indexes from a TableDiff to prevent duplicate index SQL generation. */ - public static function ensureTableFlag(Table $table): array + public static function filterTableDiff(TableDiff $tableDiff): TableDiff { - return static::ensureFlag($table, $table->getIndexes()); + $spatialFilter = static fn (Index $idx): bool => !$idx->hasFlag('spatial'); + + if (Doctrine::isV3()) { + return new TableDiff( + (string) $tableDiff->getOldTable()?->getName(), + $tableDiff->getAddedColumns(), + $tableDiff->getModifiedColumns(), + $tableDiff->getDroppedColumns(), + array_filter($tableDiff->getAddedIndexes(), $spatialFilter), + array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), + $tableDiff->getDroppedIndexes(), + $tableDiff->getOldTable(), + $tableDiff->getAddedForeignKeys(), + $tableDiff->getModifiedForeignKeys(), + $tableDiff->getDroppedForeignKeys(), + $tableDiff->getRenamedColumns(), + $tableDiff->getRenamedIndexes(), + ); + } + + return new TableDiff( + $tableDiff->getOldTable(), + $tableDiff->getAddedColumns(), + $tableDiff->getModifiedColumns(), + $tableDiff->getDroppedColumns(), + $tableDiff->getRenamedColumns(), + array_filter($tableDiff->getAddedIndexes(), $spatialFilter), + array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), + $tableDiff->getDroppedIndexes(), + $tableDiff->getRenamedIndexes(), + $tableDiff->getAddedForeignKeys(), + $tableDiff->getModifiedForeignKeys(), + $tableDiff->getDroppedForeignKeys(), + ); } /** - * Ensure the 'spatial' flag is set on PostGIS columns in a TableDiff. - * - * @return Index[] the spacial indicies + * Ensure the 'spatial' flag is set on PostGIS columns. */ - public static function ensureTableDiffFlag(TableDiff $tableDiff): array + public static function ensureSpatialIndexFlags(Table|TableDiff $table): void { + if ($table instanceof Table) { + static::applySpatialIndexFlag($table, $table->getIndexes()); + + return; + } + + $tableDiff = $table; $table = $tableDiff->getOldTable(); if (!$table) { - return []; + return; } - $addedSpatialIndexes = static::ensureFlag($table, $tableDiff->getAddedIndexes()); - - $modifiedSpatialIndexes = static::ensureFlag($table, $tableDiff->getModifiedIndexes()); - - return array_merge($addedSpatialIndexes, $modifiedSpatialIndexes); + static::applySpatialIndexFlag($table, $tableDiff->getAddedIndexes()); + static::applySpatialIndexFlag($table, $tableDiff->getModifiedIndexes()); } /** @return Index[] */ - private static function ensureFlag(Table $table, array $indexes): array + private static function applySpatialIndexFlag(Table $table, array $indexes): array { $spatialIndexes = []; diff --git a/src/Types/PostGISType.php b/src/Types/PostGISType.php index 62b2ba07..d0b73087 100644 --- a/src/Types/PostGISType.php +++ b/src/Types/PostGISType.php @@ -19,14 +19,21 @@ public function canRequireSQLConversion(): bool public function getMappedDatabaseTypes(AbstractPlatform $platform): array { - return [$this->getName()]; + return [self::lookupName($this)]; } + /** + * @param string $sqlExpr + * @param AbstractPlatform $platform + */ public function convertToPHPValueSQL($sqlExpr, $platform): string { return sprintf('ST_AsEWKT(%s)', $sqlExpr); } + /** + * @param string $sqlExpr + */ public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform): string { return sprintf('ST_GeomFromEWKT(%s)', $sqlExpr); @@ -39,7 +46,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform): st return sprintf( '%s(%s, %d)', - $this->getName(), + self::lookupName($this), $options['geometry_type'], $options['srid'] ); diff --git a/src/Utils/Doctrine.php b/src/Utils/Doctrine.php new file mode 100644 index 00000000..b3bcfe1d --- /dev/null +++ b/src/Utils/Doctrine.php @@ -0,0 +1,15 @@ +getMockForAbstractClass(AbstractPlatform::class); - - $platform - ->method('getName') - ->willReturn('postgresql'); - - return $platform; + return $this->getMockForAbstractClass(AbstractPlatform::class); } } diff --git a/tests/Driver/DriverTest.php b/tests/Driver/DriverTest.php index e9b055b1..3fdeff1c 100644 --- a/tests/Driver/DriverTest.php +++ b/tests/Driver/DriverTest.php @@ -47,15 +47,15 @@ public function testGetDatabasePlatform(): void public function providerVersions(): iterable { - yield [11]; - yield [12]; - yield [13]; - yield [14]; - yield [15]; + yield ['11']; + yield ['12']; + yield ['13']; + yield ['14']; + yield ['15']; } /** @dataProvider providerVersions */ - public function testCreateDatabasePlatformForVersion(int $version): void + public function testCreateDatabasePlatformForVersion(string $version): void { $driver = $this->getDriver(); diff --git a/tests/Driver/PostGISPlatformTest.php b/tests/Driver/PostGISPlatformTest.php index 7f6fdc05..5756229b 100644 --- a/tests/Driver/PostGISPlatformTest.php +++ b/tests/Driver/PostGISPlatformTest.php @@ -5,13 +5,10 @@ namespace Jsor\Doctrine\PostGIS\Driver; use Doctrine\DBAL\Schema\AbstractSchemaManager; -use Doctrine\DBAL\Schema\Column; -use Doctrine\DBAL\Schema\ColumnDiff; -use Doctrine\DBAL\Schema\Index; +use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaDiff; use Doctrine\DBAL\Schema\Table; -use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\AbstractFunctionalTestCase; use Jsor\Doctrine\PostGIS\Schema\SchemaManager; @@ -55,41 +52,29 @@ public function providerAlterSql(): iterable { static::_registerTypes(); - $baseTable = new Table('points'); - $baseTable->addColumn('id', 'integer'); - $baseTable->addColumn('text', 'text'); - $baseTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); - - $table = $baseTable; - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); - $schemaDiff = new SchemaDiff(); - $schemaDiff->changedTables[] = $tableDiff; - - yield 'Create index' => [$schemaDiff, ['CREATE INDEX point_idx ON points USING gist(point)'], []]; - - $table = $baseTable; - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); - $tableDiff->changedColumns[] = new ColumnDiff( - 'point', - new Column('point', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]), - ['srid'], - new Column('point', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'point', 'srid' => 4326]]), - ); - $schemaDiff = new SchemaDiff(); - $schemaDiff->changedTables[] = $tableDiff; - - yield 'Modify SRID' => [$schemaDiff, ['CREATE INDEX point_idx ON points USING gist(point)'], []]; - - $tableDiff = new TableDiff('points'); - $tableDiff->addedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); - $schemaDiff = new SchemaDiff(); - $schemaDiff->changedTables[] = $tableDiff; - - yield 'Missing fromTable' => [$schemaDiff, [], ['CREATE INDEX point_idx ON points USING gist(point)']]; + $comparator = new Comparator(new PostGISPlatform()); + + $fromTable = new Table('points'); + $fromTable->addColumn('id', 'integer'); + $fromTable->addColumn('text', 'text'); + $fromTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + + $toTable = clone $fromTable; + $toTable->addIndex(['point'], 'point_idx', ['spatial']); + + $diff = $comparator->compareSchemas(new Schema([$fromTable]), new Schema([$toTable])); + + yield 'Create index' => [$diff, ['CREATE INDEX point_idx ON points USING gist(point)'], []]; + + $fromTable = new Table('points'); + $fromTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + + $toTable = new Table('points'); + $toTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 4326]]); + + $diff = $comparator->compareSchemas(new Schema([$fromTable]), new Schema([$toTable])); + + yield 'Modify SRID' => [$diff, ["SELECT UpdateGeometrySRID('points', 'point', 4326)"], []]; } /** @dataProvider providerAlterSql */ @@ -103,7 +88,7 @@ public function testGetAlterSchemaSql(SchemaDiff $schemaDiff, array $expected, a /** @dataProvider providerAlterSql */ public function testGetAlterTableSQL(SchemaDiff $schemaDiff, array $expected, array $unexpected): void { - $tableDiffs = $schemaDiff->getAlteredTables(); + $tableDiffs = array_values($schemaDiff->getAlteredTables()); $sql = (new PostGISPlatform())->getAlterTableSQL($tableDiffs[0]); static::assertIndexes($expected, $unexpected, $sql); @@ -115,12 +100,18 @@ public function testGetAlterTableSQLCustomType(): void Type::addType('geojson', GeoJsonType::class); } - $table = new Table('points'); - $table->addColumn('id', 'integer'); - $table->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); - $tableDiff = new TableDiff('points'); - $tableDiff->addedColumns[] = new Column('boundary', Type::getType('geojson'), ['platformOptions' => ['geometry_type' => 'multipolygon', 'srid' => 3785]]); - $tableDiff->changedColumns[] = new ColumnDiff('point', new Column('point', Type::getType('geojson'), ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]), ['type']); + $comparator = new Comparator(new PostGISPlatform()); + + $fromTable = new Table('points'); + $fromTable->addColumn('id', 'integer'); + $fromTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + + $toTable = new Table('points'); + $toTable->addColumn('id', 'integer'); + $toTable->addColumn('point', 'geojson', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + $toTable->addColumn('boundary', 'geojson', ['platformOptions' => ['geometry_type' => 'multipolygon', 'srid' => 3785]]); + + $tableDiff = $comparator->compareTables($fromTable, $toTable); $sql = (new PostGISPlatform())->getAlterTableSQL($tableDiff); @@ -144,7 +135,7 @@ public function testGetCreateTablesSql(): void $table2->addColumn('id', 'integer'); $table2->addColumn('points_id', 'integer'); $table2->setPrimaryKey(['id']); - $table2->addForeignKeyConstraint($table1, ['points_id'], ['id']); + $table2->addForeignKeyConstraint($table1->getName(), ['points_id'], ['id']); $sql = (new PostGISPlatform())->getCreateTablesSQL([$table1, $table2]); @@ -174,7 +165,7 @@ public function testGetDropTableSql(): void { $table = $this->sm->introspectTable('points'); - $sql = $this->_getConnection()->getDatabasePlatform()->getDropTableSQL($table); + $sql = $this->_getConnection()->getDatabasePlatform()->getDropTableSQL($table->getName()); $this->assertEquals('DROP TABLE points', $sql); } diff --git a/tests/Schema/SchemaManagerTest.php b/tests/Schema/SchemaManagerTest.php index cf112475..38d82c4f 100644 --- a/tests/Schema/SchemaManagerTest.php +++ b/tests/Schema/SchemaManagerTest.php @@ -4,14 +4,12 @@ namespace Jsor\Doctrine\PostGIS\Schema; -use Doctrine\DBAL\Schema\Column; -use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Table; -use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\AbstractFunctionalTestCase; +use Jsor\Doctrine\PostGIS\Driver\PostGISPlatform; use Jsor\Doctrine\PostGIS\Types\GeographyType; use Jsor\Doctrine\PostGIS\Types\GeometryType; use RuntimeException; @@ -188,11 +186,12 @@ public function testAlterTableThrowsExceptionForChangedType(): void $this->expectExceptionMessage('The type of a spatial column cannot be changed (Requested changing type from "geometry" to "geography" for column "point_2d" in table "points")'); $schemaManager = $this->getSchemaManager(); - $table = $schemaManager->introspectTable('points'); + $comparator = $schemaManager->createComparator(); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedColumns[] = new ColumnDiff('point_2d', new Column('point_2d', Type::getType('geography'), []), ['type'], $table->getColumn('point_2d')); + $fromTable = $schemaManager->introspectTable('points'); + $toTable = clone $fromTable; + $toTable->modifyColumn('point_2d', ['type' => Type::getType('geography')]); + $tableDiff = $comparator->compareTables($fromTable, $toTable); $schemaManager->alterTable($tableDiff); } @@ -203,11 +202,12 @@ public function testAlterTableThrowsExceptionForChangedSpatialType(): void $this->expectExceptionMessage('The geometry_type of a spatial column cannot be changed (Requested changing type from "POINT" to "LINESTRING" for column "point_2d" in table "points")'); $schemaManager = $this->getSchemaManager(); - $table = $schemaManager->introspectTable('points'); + $comparator = $schemaManager->createComparator(); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedColumns[] = new ColumnDiff('point_2d', new Column('point_2d', Type::getType('geometry'), ['platformOptions' => ['geometry_type' => 'LINESTRING']]), ['geometry_type'], $table->getColumn('point_2d')); + $fromTable = $schemaManager->introspectTable('points'); + $toTable = clone $fromTable; + $toTable->modifyColumn('point_2d', ['platformOptions' => ['geometry_type' => 'LINESTRING']]); + $tableDiff = $comparator->compareTables($fromTable, $toTable); $schemaManager->alterTable($tableDiff); } @@ -361,7 +361,7 @@ public function testDiffListTableColumns(): void $offlineTable = $this->createTableSchema(); $onlineTable = $this->getSchemaManager()->introspectTable('points'); - $comparator = new Comparator(); + $comparator = new Comparator(new PostGISPlatform()); $diff = $comparator->compareTables($offlineTable, $onlineTable); $this->assertEmpty($diff->getAddedColumns(), 'No differences should be detected with the offline vs online schema.'); @@ -510,13 +510,14 @@ private function createTableSchema(): Table public function testAlterTableScenario(): void { $schemaManager = $this->getSchemaManager(); - $table = $schemaManager->introspectTable('points'); + $comparator = $schemaManager->createComparator(); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedColumns['linestring'] = (new Column('linestring', Type::getType('geometry')))->setPlatformOptions(['geometry_type' => 'linestring', 'srid' => 3785]); - $tableDiff->removedColumns['point'] = $table->getColumn('point'); - $tableDiff->changedColumns[] = new ColumnDiff('point_3dm', (new Column('point_3dm', Type::getType('geometry')))->setPlatformOption('srid', 4326), ['srid'], $table->getColumn('point_3dm')); + $fromTable = $schemaManager->introspectTable('points'); + $toTable = clone $fromTable; + $toTable->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $toTable->dropColumn('point'); + $toTable->modifyColumn('point_3dm', ['platformOptions' => ['geometry_type' => 'pointm', 'srid' => 4326]]); + $tableDiff = $comparator->compareTables($fromTable, $toTable); $schemaManager->alterTable($tableDiff); @@ -525,9 +526,10 @@ public function testAlterTableScenario(): void $this->assertTrue($table->hasColumn('linestring')); $this->assertEquals(4326, $table->getColumn('point_3dm')->getPlatformOption('srid')); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); + $fromTable = $schemaManager->introspectTable('points'); + $toTable = clone $fromTable; + $toTable->addIndex(['linestring'], 'linestring_idx', ['spatial']); + $tableDiff = $comparator->compareTables($fromTable, $toTable); $schemaManager->alterTable($tableDiff); @@ -538,9 +540,18 @@ public function testAlterTableScenario(): void $this->assertFalse($table->getIndex('linestring_idx')->isPrimary()); $this->assertFalse($table->getIndex('linestring_idx')->isUnique()); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedIndexes[] = new Index('linestring_idx', ['linestring', 'point_2d'], false, false, ['spatial']); + $fromTable = $schemaManager->introspectTable('points'); + $indexes = $fromTable->getIndexes(); + $indexes['linestring_idx'] = new Index('linestring_idx', ['linestring', 'point_2d'], false, false, ['spatial']); + $toTable = new Table( + $fromTable->getName(), + $fromTable->getColumns(), + $indexes, + $fromTable->getUniqueConstraints(), + $fromTable->getForeignKeys(), + $fromTable->getOptions(), + ); + $tableDiff = $comparator->compareTables($fromTable, $toTable); $schemaManager->alterTable($tableDiff); @@ -548,10 +559,19 @@ public function testAlterTableScenario(): void $this->assertTrue($table->hasIndex('linestring_idx')); $this->assertEquals(['linestring', 'point_2d'], array_map('strtolower', $table->getIndex('linestring_idx')->getColumns())); - $tableDiff = new TableDiff('points'); - - $tableDiff->fromTable = $table; - $tableDiff->renamedIndexes['linestring_idx'] = new Index('linestring_renamed_idx', ['linestring', 'point_2d'], false, false, ['spatial']); + $fromTable = $schemaManager->introspectTable('points'); + $indexes = $fromTable->getIndexes(); + unset($indexes['linestring_idx']); + $indexes['linestring_renamed_idx'] = new Index('linestring_renamed_idx', ['linestring', 'point_2d'], false, false, ['spatial']); + $toTable = new Table( + $fromTable->getName(), + $fromTable->getColumns(), + $indexes, + $fromTable->getUniqueConstraints(), + $fromTable->getForeignKeys(), + $fromTable->getOptions(), + ); + $tableDiff = $comparator->compareTables($fromTable, $toTable); $schemaManager->alterTable($tableDiff); diff --git a/tests/Schema/SpatialIndexesTest.php b/tests/Schema/SpatialIndexesTest.php index 5545496f..a65c620e 100644 --- a/tests/Schema/SpatialIndexesTest.php +++ b/tests/Schema/SpatialIndexesTest.php @@ -4,12 +4,11 @@ namespace Jsor\Doctrine\PostGIS\Schema; -use Doctrine\DBAL\Schema\Column; -use Doctrine\DBAL\Schema\Index; +use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; -use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\AbstractTestCase; +use Jsor\Doctrine\PostGIS\Driver\PostGISPlatform; /** * @covers \Jsor\Doctrine\PostGIS\Schema\SpatialIndexes @@ -27,38 +26,43 @@ protected function setUp(): void public function providerFilterTableDiff(): iterable { - $baseTable = new Table('points'); - $baseTable->addColumn('name', 'string', ['length' => 42]); - $baseTable->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); - $baseTable->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $comparator = new Comparator(new PostGISPlatform()); - $table = clone $baseTable; - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedIndexes[] = new Index('name_idx', ['name']); - $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); + $makeTable = static function (): Table { + $table = new Table('points'); + $table->addColumn('name', 'string', ['length' => 42]); + $table->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); + $table->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - yield 'Added spatial' => [$tableDiff, 1, 0]; + return $table; + }; - $table = clone $baseTable; - $table->addIndex(['name'], 'name_idx', []); - $table->addIndex(['point'], 'point_idx', []); + $fromTable = $makeTable(); + $toTable = $makeTable(); + $toTable->addIndex(['name'], 'name_idx'); + $toTable->addIndex(['linestring'], 'linestring_idx', ['spatial']); + + yield 'Added spatial' => [$comparator->compareTables($fromTable, $toTable), 1, 0]; + + $fromTable = $makeTable(); + $fromTable->addIndex(['name'], 'name_idx', []); + $fromTable->addIndex(['point'], 'point_idx', []); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedIndexes[] = new Index('name_idx', ['name']); - $tableDiff->changedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); + $toTable = $makeTable(); + $toTable->addIndex(['name'], 'name_idx'); + $toTable->addIndex(['point', 'linestring'], 'point_idx'); + $toTable->addIndex(['linestring'], 'linestring_idx', ['spatial']); - yield 'Changed spatial' => [$tableDiff, 0, 1]; + yield 'Changed spatial' => [$comparator->compareTables($fromTable, $toTable), 0, 1]; } /** @dataProvider providerFilterTableDiff */ - public function testFilterTableDiff(TableDiff $tableDiff, int $addedIndexes, int $changedIndexes): void + public function testFilterTableDiff(TableDiff $tableDiff, int $addedIndexes, int $modifiedIndexes): void { - SpatialIndexes::filterTableDiff($tableDiff); + $tableDiff = SpatialIndexes::filterTableDiff($tableDiff); - static::assertCount($addedIndexes, $tableDiff->addedIndexes); - static::assertCount($changedIndexes, $tableDiff->changedIndexes); + static::assertCount($addedIndexes, $tableDiff->getAddedIndexes(), 'Incorrect added index count'); + static::assertCount($modifiedIndexes, $tableDiff->getModifiedIndexes(), 'Incorrect modified index count'); } public function providerEnsureTableFlag(): iterable @@ -82,50 +86,58 @@ public function providerEnsureTableFlag(): iterable /** @dataProvider providerEnsureTableFlag */ public function testEnsureTableFlag(Table $table): void { - $spatialIndexes = SpatialIndexes::ensureTableFlag($table); + SpatialIndexes::ensureSpatialIndexFlags($table); + $spatialIndexes = SpatialIndexes::extractSpatialIndicies($table->getIndexes()); static::assertCount(1, $spatialIndexes); - static::assertSame('linestring_idx', $spatialIndexes[0]->getName()); - static::assertTrue($spatialIndexes[0]->hasFlag('spatial')); + static::assertSame('linestring_idx', $spatialIndexes['linestring_idx']->getName()); + static::assertTrue($spatialIndexes['linestring_idx']->hasFlag('spatial')); } - public function providerEnsureTableDiffs(): iterable + public function providerEnsureSpatialIndexFlags(): iterable { static::_registerTypes(); - $table = new Table('points'); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->addedColumns[] = (new Column('linestring', Type::getType('geometry')))->setPlatformOptions(['geometry_type' => 'linestring', 'srid' => 3785]); - $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, []); + $comparator = new Comparator(new PostGISPlatform()); - yield 'Added column and index' => [0, $tableDiff]; + $fromTable = new Table('points'); - $table = new Table('points'); - $table->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $table->addIndex(['linestring'], 'linestring_idx', []); - $tableDiff = new TableDiff('points'); - $tableDiff->fromTable = $table; - $tableDiff->changedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); + $toTable = new Table('points'); + $toTable->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $toTable->addIndex(['linestring'], 'linestring_idx', ['spatial']); - yield 'Changed index' => [1, $tableDiff]; + $tableDiff = $comparator->compareTables($fromTable, $toTable); + + yield 'Added column and index' => [1, $tableDiff]; - $tableDiff = new TableDiff('points'); - $tableDiff->addedIndexes[] = new Index('linestring_idx', ['linestring'], false, false, ['spatial']); - $tableDiff->changedIndexes[] = new Index('point_idx', ['point'], false, false, ['spatial']); + $fromTable = new Table('points'); + $fromTable->addColumn('linestring_1', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $fromTable->addColumn('linestring_2', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $fromTable->addIndex(['linestring_1'], 'linestring_idx', []); - yield 'Empty fromTable is skipped' => [0, $tableDiff]; + $toTable = new Table('points'); + $toTable->addColumn('linestring_1', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $toTable->addColumn('linestring_2', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); + $toTable->addIndex(['linestring_1', 'linestring_2'], 'linestring_idx', ['spatial']); + + $tableDiff = $comparator->compareTables($fromTable, $toTable); + + yield 'Changed index' => [1, $tableDiff]; } - /** @dataProvider providerEnsureTableDiffs */ - public function testEnsureTableDiffFlag(int $expected, TableDiff $tableDiff): void + /** @dataProvider providerEnsureSpatialIndexFlags */ + public function testEnsureSpatialIndexFlags(int $expected, TableDiff $tableDiff): void { - $spatialIndexes = SpatialIndexes::ensureTableDiffFlag($tableDiff); + SpatialIndexes::ensureSpatialIndexFlags($tableDiff); + $spatialIndexes = array_merge( + SpatialIndexes::extractSpatialIndicies($tableDiff->getAddedIndexes()), + SpatialIndexes::extractSpatialIndicies($tableDiff->getModifiedIndexes()), + ); static::assertCount($expected, $spatialIndexes); foreach ($spatialIndexes as $spatialIndex) { - static::assertTrue($spatialIndex->hasFlag('spatial')); + static::assertTrue($spatialIndex->hasFlag('spatial'), 'Missing spatial flag'); } } } diff --git a/tests/fixtures/Types/GeoJsonType.php b/tests/fixtures/Types/GeoJsonType.php index 845acaf9..dd6e0d97 100644 --- a/tests/fixtures/Types/GeoJsonType.php +++ b/tests/fixtures/Types/GeoJsonType.php @@ -34,7 +34,7 @@ public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform): return sprintf('ST_GeomFromGeoJSON(%s)::geography', $sqlExpr); } - public function convertToDatabaseValue($value, AbstractPlatform $platform) + public function convertToDatabaseValue($value, AbstractPlatform $platform): mixed { return parent::convertToDatabaseValue(json_encode($value), $platform); } diff --git a/tests/fixtures/points_drop.sql b/tests/fixtures/points_drop.sql index 6241dde6..b4fbc54e 100644 --- a/tests/fixtures/points_drop.sql +++ b/tests/fixtures/points_drop.sql @@ -1,2 +1,2 @@ -DROP SEQUENCE IF EXISTS points_id_seq CASCADE; DROP TABLE IF EXISTS points; +DROP SEQUENCE IF EXISTS points_id_seq CASCADE; From 4ec73b946907f4352a3d30e94deb1aecda582799 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Thu, 7 Mar 2024 17:06:15 +0100 Subject: [PATCH 09/19] Switch functions from Lexer constants to TokenType enum --- src/Functions/Geography.php | 8 +++---- src/Functions/Geometry.php | 8 +++---- src/Functions/GeometryType.php | 8 +++---- src/Functions/ST_3DClosestPoint.php | 10 ++++---- src/Functions/ST_3DDFullyWithin.php | 12 +++++----- src/Functions/ST_3DDWithin.php | 12 +++++----- src/Functions/ST_3DDistance.php | 10 ++++---- src/Functions/ST_3DIntersects.php | 10 ++++---- src/Functions/ST_3DLength.php | 8 +++---- src/Functions/ST_3DLongestLine.php | 10 ++++---- src/Functions/ST_3DMakeBox.php | 10 ++++---- src/Functions/ST_3DMaxDistance.php | 10 ++++---- src/Functions/ST_3DShortestLine.php | 10 ++++---- src/Functions/ST_AddPoint.php | 14 +++++------ src/Functions/ST_Area.php | 12 +++++----- src/Functions/ST_AsBinary.php | 12 +++++----- src/Functions/ST_AsEWKB.php | 12 +++++----- src/Functions/ST_AsEWKT.php | 8 +++---- src/Functions/ST_AsGML.php | 28 +++++++++++----------- src/Functions/ST_AsGeoJSON.php | 20 ++++++++-------- src/Functions/ST_AsHEXEWKB.php | 12 +++++----- src/Functions/ST_AsLatLonText.php | 12 +++++----- src/Functions/ST_AsSVG.php | 16 ++++++------- src/Functions/ST_AsText.php | 8 +++---- src/Functions/ST_Azimuth.php | 10 ++++---- src/Functions/ST_Boundary.php | 8 +++---- src/Functions/ST_Box2dFromGeoHash.php | 12 +++++----- src/Functions/ST_Buffer.php | 14 +++++------ src/Functions/ST_Centroid.php | 8 +++---- src/Functions/ST_ClosestPoint.php | 10 ++++---- src/Functions/ST_Collect.php | 12 +++++----- src/Functions/ST_Contains.php | 10 ++++---- src/Functions/ST_ContainsProperly.php | 10 ++++---- src/Functions/ST_CoordDim.php | 8 +++---- src/Functions/ST_CoveredBy.php | 10 ++++---- src/Functions/ST_Covers.php | 10 ++++---- src/Functions/ST_Crosses.php | 10 ++++---- src/Functions/ST_DFullyWithin.php | 12 +++++----- src/Functions/ST_DWithin.php | 16 ++++++------- src/Functions/ST_Difference.php | 10 ++++---- src/Functions/ST_Dimension.php | 8 +++---- src/Functions/ST_Disjoint.php | 10 ++++---- src/Functions/ST_Distance.php | 14 +++++------ src/Functions/ST_DistanceSphere.php | 10 ++++---- src/Functions/ST_DistanceSpheroid.php | 14 +++++------ src/Functions/ST_EndPoint.php | 8 +++---- src/Functions/ST_Envelope.php | 8 +++---- src/Functions/ST_Equals.php | 10 ++++---- src/Functions/ST_Extent.php | 8 +++---- src/Functions/ST_ExteriorRing.php | 8 +++---- src/Functions/ST_FlipCoordinates.php | 8 +++---- src/Functions/ST_GeoHash.php | 12 +++++----- src/Functions/ST_GeogFromText.php | 8 +++---- src/Functions/ST_GeogFromWKB.php | 8 +++---- src/Functions/ST_GeographyFromText.php | 8 +++---- src/Functions/ST_GeomCollFromText.php | 12 +++++----- src/Functions/ST_GeomFromEWKB.php | 8 +++---- src/Functions/ST_GeomFromEWKT.php | 8 +++---- src/Functions/ST_GeomFromGML.php | 12 +++++----- src/Functions/ST_GeomFromGeoHash.php | 12 +++++----- src/Functions/ST_GeomFromGeoJSON.php | 8 +++---- src/Functions/ST_GeomFromKML.php | 8 +++---- src/Functions/ST_GeomFromText.php | 12 +++++----- src/Functions/ST_GeomFromWKB.php | 12 +++++----- src/Functions/ST_GeometryFromText.php | 12 +++++----- src/Functions/ST_GeometryN.php | 10 ++++---- src/Functions/ST_GeometryType.php | 8 +++---- src/Functions/ST_HasArc.php | 8 +++---- src/Functions/ST_HausdorffDistance.php | 14 +++++------ src/Functions/ST_InteriorRingN.php | 10 ++++---- src/Functions/ST_Intersection.php | 10 ++++---- src/Functions/ST_Intersects.php | 10 ++++---- src/Functions/ST_IsClosed.php | 8 +++---- src/Functions/ST_IsCollection.php | 8 +++---- src/Functions/ST_IsEmpty.php | 8 +++---- src/Functions/ST_IsRing.php | 8 +++---- src/Functions/ST_IsSimple.php | 8 +++---- src/Functions/ST_IsValid.php | 12 +++++----- src/Functions/ST_IsValidDetail.php | 12 +++++----- src/Functions/ST_IsValidReason.php | 12 +++++----- src/Functions/ST_Length.php | 12 +++++----- src/Functions/ST_LengthSpheroid.php | 10 ++++---- src/Functions/ST_LineCrossingDirection.php | 10 ++++---- src/Functions/ST_LineFromMultiPoint.php | 8 +++---- src/Functions/ST_LineFromText.php | 12 +++++----- src/Functions/ST_LineFromWKB.php | 12 +++++----- src/Functions/ST_LinestringFromWKB.php | 12 +++++----- src/Functions/ST_LongestLine.php | 10 ++++---- src/Functions/ST_M.php | 8 +++---- src/Functions/ST_MLineFromText.php | 12 +++++----- src/Functions/ST_MPointFromText.php | 12 +++++----- src/Functions/ST_MPolyFromText.php | 12 +++++----- src/Functions/ST_MakeBox2D.php | 10 ++++---- src/Functions/ST_MakeEnvelope.php | 18 +++++++------- src/Functions/ST_MakeLine.php | 12 +++++----- src/Functions/ST_MakePoint.php | 18 +++++++------- src/Functions/ST_MakePointM.php | 12 +++++----- src/Functions/ST_MakePolygon.php | 12 +++++----- src/Functions/ST_MaxDistance.php | 10 ++++---- src/Functions/ST_MinimumBoundingCircle.php | 12 +++++----- src/Functions/ST_Multi.php | 8 +++---- src/Functions/ST_NDims.php | 8 +++---- src/Functions/ST_NPoints.php | 8 +++---- src/Functions/ST_NRings.php | 8 +++---- src/Functions/ST_NumGeometries.php | 8 +++---- src/Functions/ST_NumInteriorRing.php | 8 +++---- src/Functions/ST_NumInteriorRings.php | 8 +++---- src/Functions/ST_NumPatches.php | 8 +++---- src/Functions/ST_NumPoints.php | 8 +++---- src/Functions/ST_OrderingEquals.php | 10 ++++---- src/Functions/ST_Overlaps.php | 10 ++++---- src/Functions/ST_PatchN.php | 10 ++++---- src/Functions/ST_Perimeter.php | 12 +++++----- src/Functions/ST_Point.php | 10 ++++---- src/Functions/ST_PointFromGeoHash.php | 12 +++++----- src/Functions/ST_PointFromText.php | 12 +++++----- src/Functions/ST_PointFromWKB.php | 12 +++++----- src/Functions/ST_PointN.php | 10 ++++---- src/Functions/ST_PointOnSurface.php | 8 +++---- src/Functions/ST_Polygon.php | 10 ++++---- src/Functions/ST_PolygonFromText.php | 12 +++++----- src/Functions/ST_Project.php | 12 +++++----- src/Functions/ST_Relate.php | 14 +++++------ src/Functions/ST_SRID.php | 8 +++---- src/Functions/ST_Scale.php | 16 ++++++------- src/Functions/ST_SetSRID.php | 10 ++++---- src/Functions/ST_ShiftLongitude.php | 8 +++---- src/Functions/ST_ShortestLine.php | 10 ++++---- src/Functions/ST_SnapToGrid.php | 26 ++++++++++---------- src/Functions/ST_Split.php | 10 ++++---- src/Functions/ST_StartPoint.php | 8 +++---- src/Functions/ST_Summary.php | 8 +++---- src/Functions/ST_SymDifference.php | 10 ++++---- src/Functions/ST_Touches.php | 10 ++++---- src/Functions/ST_TransScale.php | 16 ++++++------- src/Functions/ST_Transform.php | 10 ++++---- src/Functions/ST_Translate.php | 16 ++++++------- src/Functions/ST_Union.php | 12 +++++----- src/Functions/ST_Within.php | 10 ++++---- src/Functions/ST_X.php | 8 +++---- src/Functions/ST_XMax.php | 8 +++---- src/Functions/ST_XMin.php | 8 +++---- src/Functions/ST_Y.php | 8 +++---- src/Functions/ST_YMax.php | 8 +++---- src/Functions/ST_YMin.php | 8 +++---- src/Functions/ST_Z.php | 8 +++---- src/Functions/ST_ZMax.php | 8 +++---- src/Functions/ST_ZMin.php | 8 +++---- src/Functions/ST_Zmflag.php | 8 +++---- tools/generate-functions.php | 14 +++++------ 150 files changed, 792 insertions(+), 792 deletions(-) diff --git a/src/Functions/Geography.php b/src/Functions/Geography.php index 526a9bd7..2bc5be6e 100644 --- a/src/Functions/Geography.php +++ b/src/Functions/Geography.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class Geography extends FunctionNode { @@ -18,12 +18,12 @@ final class Geography extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/Geometry.php b/src/Functions/Geometry.php index 0268ee8a..eb4c5233 100644 --- a/src/Functions/Geometry.php +++ b/src/Functions/Geometry.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class Geometry extends FunctionNode { @@ -18,12 +18,12 @@ final class Geometry extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/GeometryType.php b/src/Functions/GeometryType.php index 5a3870ac..29dcf114 100644 --- a/src/Functions/GeometryType.php +++ b/src/Functions/GeometryType.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class GeometryType extends FunctionNode { @@ -18,12 +18,12 @@ final class GeometryType extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DClosestPoint.php b/src/Functions/ST_3DClosestPoint.php index cff73560..b734331f 100644 --- a/src/Functions/ST_3DClosestPoint.php +++ b/src/Functions/ST_3DClosestPoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DClosestPoint extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_3DClosestPoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DDFullyWithin.php b/src/Functions/ST_3DDFullyWithin.php index 133e9b00..52bd3f96 100644 --- a/src/Functions/ST_3DDFullyWithin.php +++ b/src/Functions/ST_3DDFullyWithin.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DDFullyWithin extends FunctionNode { @@ -18,20 +18,20 @@ final class ST_3DDFullyWithin extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DDWithin.php b/src/Functions/ST_3DDWithin.php index b75b340a..f00e7b89 100644 --- a/src/Functions/ST_3DDWithin.php +++ b/src/Functions/ST_3DDWithin.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DDWithin extends FunctionNode { @@ -18,20 +18,20 @@ final class ST_3DDWithin extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DDistance.php b/src/Functions/ST_3DDistance.php index 3354ff9a..0eff260a 100644 --- a/src/Functions/ST_3DDistance.php +++ b/src/Functions/ST_3DDistance.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DDistance extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_3DDistance extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DIntersects.php b/src/Functions/ST_3DIntersects.php index 85f498d1..f1dd7103 100644 --- a/src/Functions/ST_3DIntersects.php +++ b/src/Functions/ST_3DIntersects.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DIntersects extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_3DIntersects extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DLength.php b/src/Functions/ST_3DLength.php index 113bc9f0..6beff546 100644 --- a/src/Functions/ST_3DLength.php +++ b/src/Functions/ST_3DLength.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DLength extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_3DLength extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DLongestLine.php b/src/Functions/ST_3DLongestLine.php index a5d89452..c4b6948f 100644 --- a/src/Functions/ST_3DLongestLine.php +++ b/src/Functions/ST_3DLongestLine.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DLongestLine extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_3DLongestLine extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DMakeBox.php b/src/Functions/ST_3DMakeBox.php index 63442727..b58369b5 100644 --- a/src/Functions/ST_3DMakeBox.php +++ b/src/Functions/ST_3DMakeBox.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DMakeBox extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_3DMakeBox extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DMaxDistance.php b/src/Functions/ST_3DMaxDistance.php index d8af0a49..898e12b3 100644 --- a/src/Functions/ST_3DMaxDistance.php +++ b/src/Functions/ST_3DMaxDistance.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DMaxDistance extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_3DMaxDistance extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_3DShortestLine.php b/src/Functions/ST_3DShortestLine.php index 474abd3f..90f84eba 100644 --- a/src/Functions/ST_3DShortestLine.php +++ b/src/Functions/ST_3DShortestLine.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_3DShortestLine extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_3DShortestLine extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AddPoint.php b/src/Functions/ST_AddPoint.php index 14daaba8..04cc7418 100644 --- a/src/Functions/ST_AddPoint.php +++ b/src/Functions/ST_AddPoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AddPoint extends FunctionNode { @@ -18,23 +18,23 @@ final class ST_AddPoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Area.php b/src/Functions/ST_Area.php index 2d903cac..c06766f4 100644 --- a/src/Functions/ST_Area.php +++ b/src/Functions/ST_Area.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Area extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_Area extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsBinary.php b/src/Functions/ST_AsBinary.php index b103d27a..fd07f3b3 100644 --- a/src/Functions/ST_AsBinary.php +++ b/src/Functions/ST_AsBinary.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsBinary extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_AsBinary extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsEWKB.php b/src/Functions/ST_AsEWKB.php index 28b862d5..20b5d188 100644 --- a/src/Functions/ST_AsEWKB.php +++ b/src/Functions/ST_AsEWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsEWKB extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_AsEWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsEWKT.php b/src/Functions/ST_AsEWKT.php index 4f998a82..b2326718 100644 --- a/src/Functions/ST_AsEWKT.php +++ b/src/Functions/ST_AsEWKT.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsEWKT extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_AsEWKT extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsGML.php b/src/Functions/ST_AsGML.php index 021b3725..e733b1ee 100644 --- a/src/Functions/ST_AsGML.php +++ b/src/Functions/ST_AsGML.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsGML extends FunctionNode { @@ -18,39 +18,39 @@ final class ST_AsGML extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsGeoJSON.php b/src/Functions/ST_AsGeoJSON.php index cd23842e..701f0405 100644 --- a/src/Functions/ST_AsGeoJSON.php +++ b/src/Functions/ST_AsGeoJSON.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsGeoJSON extends FunctionNode { @@ -18,29 +18,29 @@ final class ST_AsGeoJSON extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsHEXEWKB.php b/src/Functions/ST_AsHEXEWKB.php index 0bc758b7..1517a269 100644 --- a/src/Functions/ST_AsHEXEWKB.php +++ b/src/Functions/ST_AsHEXEWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsHEXEWKB extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_AsHEXEWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsLatLonText.php b/src/Functions/ST_AsLatLonText.php index 42ff41e6..94272e40 100644 --- a/src/Functions/ST_AsLatLonText.php +++ b/src/Functions/ST_AsLatLonText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsLatLonText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_AsLatLonText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsSVG.php b/src/Functions/ST_AsSVG.php index c3fd4726..a2118507 100644 --- a/src/Functions/ST_AsSVG.php +++ b/src/Functions/ST_AsSVG.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsSVG extends FunctionNode { @@ -18,24 +18,24 @@ final class ST_AsSVG extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_AsText.php b/src/Functions/ST_AsText.php index 15e19b1e..fdf47e1a 100644 --- a/src/Functions/ST_AsText.php +++ b/src/Functions/ST_AsText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_AsText extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_AsText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Azimuth.php b/src/Functions/ST_Azimuth.php index ea4020fe..450a0c52 100644 --- a/src/Functions/ST_Azimuth.php +++ b/src/Functions/ST_Azimuth.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Azimuth extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Azimuth extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Boundary.php b/src/Functions/ST_Boundary.php index f3e2338c..b1c4dd9a 100644 --- a/src/Functions/ST_Boundary.php +++ b/src/Functions/ST_Boundary.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Boundary extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Boundary extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Box2dFromGeoHash.php b/src/Functions/ST_Box2dFromGeoHash.php index 3c0e3477..eddf2168 100644 --- a/src/Functions/ST_Box2dFromGeoHash.php +++ b/src/Functions/ST_Box2dFromGeoHash.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Box2dFromGeoHash extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_Box2dFromGeoHash extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Buffer.php b/src/Functions/ST_Buffer.php index 079a2b25..8c01cf02 100644 --- a/src/Functions/ST_Buffer.php +++ b/src/Functions/ST_Buffer.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Buffer extends FunctionNode { @@ -18,23 +18,23 @@ final class ST_Buffer extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Centroid.php b/src/Functions/ST_Centroid.php index 673b89e3..98636ddd 100644 --- a/src/Functions/ST_Centroid.php +++ b/src/Functions/ST_Centroid.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Centroid extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Centroid extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_ClosestPoint.php b/src/Functions/ST_ClosestPoint.php index 75ac3f82..3cd537e3 100644 --- a/src/Functions/ST_ClosestPoint.php +++ b/src/Functions/ST_ClosestPoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_ClosestPoint extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_ClosestPoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Collect.php b/src/Functions/ST_Collect.php index 30e61a76..1f8ca081 100644 --- a/src/Functions/ST_Collect.php +++ b/src/Functions/ST_Collect.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Collect extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_Collect extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Contains.php b/src/Functions/ST_Contains.php index 6f7f6bc7..dffac3bb 100644 --- a/src/Functions/ST_Contains.php +++ b/src/Functions/ST_Contains.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Contains extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Contains extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_ContainsProperly.php b/src/Functions/ST_ContainsProperly.php index 4d013f28..08876849 100644 --- a/src/Functions/ST_ContainsProperly.php +++ b/src/Functions/ST_ContainsProperly.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_ContainsProperly extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_ContainsProperly extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_CoordDim.php b/src/Functions/ST_CoordDim.php index 4097478c..9ef1431c 100644 --- a/src/Functions/ST_CoordDim.php +++ b/src/Functions/ST_CoordDim.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_CoordDim extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_CoordDim extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_CoveredBy.php b/src/Functions/ST_CoveredBy.php index fb52684b..a4aeb405 100644 --- a/src/Functions/ST_CoveredBy.php +++ b/src/Functions/ST_CoveredBy.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_CoveredBy extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_CoveredBy extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Covers.php b/src/Functions/ST_Covers.php index df0b9c9c..837eabbe 100644 --- a/src/Functions/ST_Covers.php +++ b/src/Functions/ST_Covers.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Covers extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Covers extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Crosses.php b/src/Functions/ST_Crosses.php index bb826558..851fc347 100644 --- a/src/Functions/ST_Crosses.php +++ b/src/Functions/ST_Crosses.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Crosses extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Crosses extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_DFullyWithin.php b/src/Functions/ST_DFullyWithin.php index e77c9623..1242f9b2 100644 --- a/src/Functions/ST_DFullyWithin.php +++ b/src/Functions/ST_DFullyWithin.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_DFullyWithin extends FunctionNode { @@ -18,20 +18,20 @@ final class ST_DFullyWithin extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_DWithin.php b/src/Functions/ST_DWithin.php index 196bc6bd..52976e52 100644 --- a/src/Functions/ST_DWithin.php +++ b/src/Functions/ST_DWithin.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_DWithin extends FunctionNode { @@ -18,27 +18,27 @@ final class ST_DWithin extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Difference.php b/src/Functions/ST_Difference.php index 30c41e8c..aedfa2fc 100644 --- a/src/Functions/ST_Difference.php +++ b/src/Functions/ST_Difference.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Difference extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Difference extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Dimension.php b/src/Functions/ST_Dimension.php index f1241ba2..207b715d 100644 --- a/src/Functions/ST_Dimension.php +++ b/src/Functions/ST_Dimension.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Dimension extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Dimension extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Disjoint.php b/src/Functions/ST_Disjoint.php index b777a0cc..1a3ba754 100644 --- a/src/Functions/ST_Disjoint.php +++ b/src/Functions/ST_Disjoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Disjoint extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Disjoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Distance.php b/src/Functions/ST_Distance.php index 5a78c580..58980859 100644 --- a/src/Functions/ST_Distance.php +++ b/src/Functions/ST_Distance.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Distance extends FunctionNode { @@ -18,23 +18,23 @@ final class ST_Distance extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_DistanceSphere.php b/src/Functions/ST_DistanceSphere.php index 1426528c..7c114ac2 100644 --- a/src/Functions/ST_DistanceSphere.php +++ b/src/Functions/ST_DistanceSphere.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_DistanceSphere extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_DistanceSphere extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_DistanceSpheroid.php b/src/Functions/ST_DistanceSpheroid.php index 348465c0..0b44c38e 100644 --- a/src/Functions/ST_DistanceSpheroid.php +++ b/src/Functions/ST_DistanceSpheroid.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_DistanceSpheroid extends FunctionNode { @@ -18,23 +18,23 @@ final class ST_DistanceSpheroid extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_EndPoint.php b/src/Functions/ST_EndPoint.php index d0adad01..17843c6d 100644 --- a/src/Functions/ST_EndPoint.php +++ b/src/Functions/ST_EndPoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_EndPoint extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_EndPoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Envelope.php b/src/Functions/ST_Envelope.php index 05c38f08..d3a53b88 100644 --- a/src/Functions/ST_Envelope.php +++ b/src/Functions/ST_Envelope.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Envelope extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Envelope extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Equals.php b/src/Functions/ST_Equals.php index 4c8f425f..4818a0f7 100644 --- a/src/Functions/ST_Equals.php +++ b/src/Functions/ST_Equals.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Equals extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Equals extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Extent.php b/src/Functions/ST_Extent.php index 3c43a273..063f235f 100644 --- a/src/Functions/ST_Extent.php +++ b/src/Functions/ST_Extent.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Extent extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Extent extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_ExteriorRing.php b/src/Functions/ST_ExteriorRing.php index 195a5f42..690901a0 100644 --- a/src/Functions/ST_ExteriorRing.php +++ b/src/Functions/ST_ExteriorRing.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_ExteriorRing extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_ExteriorRing extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_FlipCoordinates.php b/src/Functions/ST_FlipCoordinates.php index 36579a2a..95bc208e 100644 --- a/src/Functions/ST_FlipCoordinates.php +++ b/src/Functions/ST_FlipCoordinates.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_FlipCoordinates extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_FlipCoordinates extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeoHash.php b/src/Functions/ST_GeoHash.php index e063ee8c..9bb2c3ae 100644 --- a/src/Functions/ST_GeoHash.php +++ b/src/Functions/ST_GeoHash.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeoHash extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_GeoHash extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeogFromText.php b/src/Functions/ST_GeogFromText.php index d2cbb917..9c0a3b53 100644 --- a/src/Functions/ST_GeogFromText.php +++ b/src/Functions/ST_GeogFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeogFromText extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeogFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeogFromWKB.php b/src/Functions/ST_GeogFromWKB.php index 2ca24948..50e0869b 100644 --- a/src/Functions/ST_GeogFromWKB.php +++ b/src/Functions/ST_GeogFromWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeogFromWKB extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeogFromWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeographyFromText.php b/src/Functions/ST_GeographyFromText.php index 5aa24402..524e047f 100644 --- a/src/Functions/ST_GeographyFromText.php +++ b/src/Functions/ST_GeographyFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeographyFromText extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeographyFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomCollFromText.php b/src/Functions/ST_GeomCollFromText.php index 224cc892..787ca38b 100644 --- a/src/Functions/ST_GeomCollFromText.php +++ b/src/Functions/ST_GeomCollFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomCollFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_GeomCollFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromEWKB.php b/src/Functions/ST_GeomFromEWKB.php index e44e99e0..de84f115 100644 --- a/src/Functions/ST_GeomFromEWKB.php +++ b/src/Functions/ST_GeomFromEWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromEWKB extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeomFromEWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromEWKT.php b/src/Functions/ST_GeomFromEWKT.php index aa6bae3b..ae2be44f 100644 --- a/src/Functions/ST_GeomFromEWKT.php +++ b/src/Functions/ST_GeomFromEWKT.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromEWKT extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeomFromEWKT extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromGML.php b/src/Functions/ST_GeomFromGML.php index b3345b89..39bd8d0b 100644 --- a/src/Functions/ST_GeomFromGML.php +++ b/src/Functions/ST_GeomFromGML.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromGML extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_GeomFromGML extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromGeoHash.php b/src/Functions/ST_GeomFromGeoHash.php index fbdba674..033c424c 100644 --- a/src/Functions/ST_GeomFromGeoHash.php +++ b/src/Functions/ST_GeomFromGeoHash.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromGeoHash extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_GeomFromGeoHash extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromGeoJSON.php b/src/Functions/ST_GeomFromGeoJSON.php index 0788f8f1..999a2d7a 100644 --- a/src/Functions/ST_GeomFromGeoJSON.php +++ b/src/Functions/ST_GeomFromGeoJSON.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromGeoJSON extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeomFromGeoJSON extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromKML.php b/src/Functions/ST_GeomFromKML.php index 6d5b4d5e..467bf0e7 100644 --- a/src/Functions/ST_GeomFromKML.php +++ b/src/Functions/ST_GeomFromKML.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromKML extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeomFromKML extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromText.php b/src/Functions/ST_GeomFromText.php index f1763d52..d36dddec 100644 --- a/src/Functions/ST_GeomFromText.php +++ b/src/Functions/ST_GeomFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_GeomFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeomFromWKB.php b/src/Functions/ST_GeomFromWKB.php index d2787f82..ea7e9e66 100644 --- a/src/Functions/ST_GeomFromWKB.php +++ b/src/Functions/ST_GeomFromWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeomFromWKB extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_GeomFromWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeometryFromText.php b/src/Functions/ST_GeometryFromText.php index 93a53dd8..7fdd67b1 100644 --- a/src/Functions/ST_GeometryFromText.php +++ b/src/Functions/ST_GeometryFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeometryFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_GeometryFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeometryN.php b/src/Functions/ST_GeometryN.php index b661a09b..98d194a8 100644 --- a/src/Functions/ST_GeometryN.php +++ b/src/Functions/ST_GeometryN.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeometryN extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_GeometryN extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_GeometryType.php b/src/Functions/ST_GeometryType.php index 481e73cd..94f735a2 100644 --- a/src/Functions/ST_GeometryType.php +++ b/src/Functions/ST_GeometryType.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_GeometryType extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_GeometryType extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_HasArc.php b/src/Functions/ST_HasArc.php index d23a4a47..912a1c78 100644 --- a/src/Functions/ST_HasArc.php +++ b/src/Functions/ST_HasArc.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_HasArc extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_HasArc extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_HausdorffDistance.php b/src/Functions/ST_HausdorffDistance.php index 19639193..8beba419 100644 --- a/src/Functions/ST_HausdorffDistance.php +++ b/src/Functions/ST_HausdorffDistance.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_HausdorffDistance extends FunctionNode { @@ -18,23 +18,23 @@ final class ST_HausdorffDistance extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_InteriorRingN.php b/src/Functions/ST_InteriorRingN.php index 88c6c369..610fc5e9 100644 --- a/src/Functions/ST_InteriorRingN.php +++ b/src/Functions/ST_InteriorRingN.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_InteriorRingN extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_InteriorRingN extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Intersection.php b/src/Functions/ST_Intersection.php index b2e3daba..0f0b7fd1 100644 --- a/src/Functions/ST_Intersection.php +++ b/src/Functions/ST_Intersection.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Intersection extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Intersection extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Intersects.php b/src/Functions/ST_Intersects.php index f72b2907..f53ca86a 100644 --- a/src/Functions/ST_Intersects.php +++ b/src/Functions/ST_Intersects.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Intersects extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Intersects extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsClosed.php b/src/Functions/ST_IsClosed.php index 609f7b67..00de90b9 100644 --- a/src/Functions/ST_IsClosed.php +++ b/src/Functions/ST_IsClosed.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsClosed extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_IsClosed extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsCollection.php b/src/Functions/ST_IsCollection.php index c655d5fd..a6b1e50e 100644 --- a/src/Functions/ST_IsCollection.php +++ b/src/Functions/ST_IsCollection.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsCollection extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_IsCollection extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsEmpty.php b/src/Functions/ST_IsEmpty.php index 563b2df7..4ffd3604 100644 --- a/src/Functions/ST_IsEmpty.php +++ b/src/Functions/ST_IsEmpty.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsEmpty extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_IsEmpty extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsRing.php b/src/Functions/ST_IsRing.php index 2fc3ef56..040c43dd 100644 --- a/src/Functions/ST_IsRing.php +++ b/src/Functions/ST_IsRing.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsRing extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_IsRing extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsSimple.php b/src/Functions/ST_IsSimple.php index 672a0554..8735a69c 100644 --- a/src/Functions/ST_IsSimple.php +++ b/src/Functions/ST_IsSimple.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsSimple extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_IsSimple extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsValid.php b/src/Functions/ST_IsValid.php index 42d93688..3a5993dd 100644 --- a/src/Functions/ST_IsValid.php +++ b/src/Functions/ST_IsValid.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsValid extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_IsValid extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsValidDetail.php b/src/Functions/ST_IsValidDetail.php index ec460d3e..3b7242c3 100644 --- a/src/Functions/ST_IsValidDetail.php +++ b/src/Functions/ST_IsValidDetail.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsValidDetail extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_IsValidDetail extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_IsValidReason.php b/src/Functions/ST_IsValidReason.php index 59103839..e6fa9f5a 100644 --- a/src/Functions/ST_IsValidReason.php +++ b/src/Functions/ST_IsValidReason.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_IsValidReason extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_IsValidReason extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Length.php b/src/Functions/ST_Length.php index 3130ea80..464a8f34 100644 --- a/src/Functions/ST_Length.php +++ b/src/Functions/ST_Length.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Length extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_Length extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_LengthSpheroid.php b/src/Functions/ST_LengthSpheroid.php index aeea0ca3..4998db54 100644 --- a/src/Functions/ST_LengthSpheroid.php +++ b/src/Functions/ST_LengthSpheroid.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_LengthSpheroid extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_LengthSpheroid extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_LineCrossingDirection.php b/src/Functions/ST_LineCrossingDirection.php index 0106f946..548527cf 100644 --- a/src/Functions/ST_LineCrossingDirection.php +++ b/src/Functions/ST_LineCrossingDirection.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_LineCrossingDirection extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_LineCrossingDirection extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_LineFromMultiPoint.php b/src/Functions/ST_LineFromMultiPoint.php index 27c9f2a8..98be3442 100644 --- a/src/Functions/ST_LineFromMultiPoint.php +++ b/src/Functions/ST_LineFromMultiPoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_LineFromMultiPoint extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_LineFromMultiPoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_LineFromText.php b/src/Functions/ST_LineFromText.php index a7477f37..7b37a891 100644 --- a/src/Functions/ST_LineFromText.php +++ b/src/Functions/ST_LineFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_LineFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_LineFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_LineFromWKB.php b/src/Functions/ST_LineFromWKB.php index 052d800b..b68eef76 100644 --- a/src/Functions/ST_LineFromWKB.php +++ b/src/Functions/ST_LineFromWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_LineFromWKB extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_LineFromWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_LinestringFromWKB.php b/src/Functions/ST_LinestringFromWKB.php index 4216c351..693656ec 100644 --- a/src/Functions/ST_LinestringFromWKB.php +++ b/src/Functions/ST_LinestringFromWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_LinestringFromWKB extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_LinestringFromWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_LongestLine.php b/src/Functions/ST_LongestLine.php index 1d91b341..95b128d4 100644 --- a/src/Functions/ST_LongestLine.php +++ b/src/Functions/ST_LongestLine.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_LongestLine extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_LongestLine extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_M.php b/src/Functions/ST_M.php index 1166c15d..c21b5e06 100644 --- a/src/Functions/ST_M.php +++ b/src/Functions/ST_M.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_M extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_M extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MLineFromText.php b/src/Functions/ST_MLineFromText.php index b754e1ea..d7e002d6 100644 --- a/src/Functions/ST_MLineFromText.php +++ b/src/Functions/ST_MLineFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MLineFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_MLineFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MPointFromText.php b/src/Functions/ST_MPointFromText.php index 98254a03..9b25a194 100644 --- a/src/Functions/ST_MPointFromText.php +++ b/src/Functions/ST_MPointFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MPointFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_MPointFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MPolyFromText.php b/src/Functions/ST_MPolyFromText.php index 91d2f073..914d2d61 100644 --- a/src/Functions/ST_MPolyFromText.php +++ b/src/Functions/ST_MPolyFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MPolyFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_MPolyFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MakeBox2D.php b/src/Functions/ST_MakeBox2D.php index 2d548d5d..dedc3d31 100644 --- a/src/Functions/ST_MakeBox2D.php +++ b/src/Functions/ST_MakeBox2D.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MakeBox2D extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_MakeBox2D extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MakeEnvelope.php b/src/Functions/ST_MakeEnvelope.php index 653e3cee..e5ef8d93 100644 --- a/src/Functions/ST_MakeEnvelope.php +++ b/src/Functions/ST_MakeEnvelope.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MakeEnvelope extends FunctionNode { @@ -18,31 +18,31 @@ final class ST_MakeEnvelope extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MakeLine.php b/src/Functions/ST_MakeLine.php index d84d3300..8b5d1894 100644 --- a/src/Functions/ST_MakeLine.php +++ b/src/Functions/ST_MakeLine.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MakeLine extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_MakeLine extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MakePoint.php b/src/Functions/ST_MakePoint.php index 33fa35af..a03cf119 100644 --- a/src/Functions/ST_MakePoint.php +++ b/src/Functions/ST_MakePoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MakePoint extends FunctionNode { @@ -18,28 +18,28 @@ final class ST_MakePoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MakePointM.php b/src/Functions/ST_MakePointM.php index 610ae191..fecdc849 100644 --- a/src/Functions/ST_MakePointM.php +++ b/src/Functions/ST_MakePointM.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MakePointM extends FunctionNode { @@ -18,20 +18,20 @@ final class ST_MakePointM extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MakePolygon.php b/src/Functions/ST_MakePolygon.php index 390f1fda..8933879b 100644 --- a/src/Functions/ST_MakePolygon.php +++ b/src/Functions/ST_MakePolygon.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MakePolygon extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_MakePolygon extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MaxDistance.php b/src/Functions/ST_MaxDistance.php index 91ff4445..20b30633 100644 --- a/src/Functions/ST_MaxDistance.php +++ b/src/Functions/ST_MaxDistance.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MaxDistance extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_MaxDistance extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_MinimumBoundingCircle.php b/src/Functions/ST_MinimumBoundingCircle.php index 8781a36e..38aac913 100644 --- a/src/Functions/ST_MinimumBoundingCircle.php +++ b/src/Functions/ST_MinimumBoundingCircle.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_MinimumBoundingCircle extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_MinimumBoundingCircle extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Multi.php b/src/Functions/ST_Multi.php index 4c33a796..2741b557 100644 --- a/src/Functions/ST_Multi.php +++ b/src/Functions/ST_Multi.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Multi extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Multi extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NDims.php b/src/Functions/ST_NDims.php index f8f32245..52b5023c 100644 --- a/src/Functions/ST_NDims.php +++ b/src/Functions/ST_NDims.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NDims extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NDims extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NPoints.php b/src/Functions/ST_NPoints.php index 6c99f108..695cc396 100644 --- a/src/Functions/ST_NPoints.php +++ b/src/Functions/ST_NPoints.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NPoints extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NPoints extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NRings.php b/src/Functions/ST_NRings.php index ab4d698f..82f4adba 100644 --- a/src/Functions/ST_NRings.php +++ b/src/Functions/ST_NRings.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NRings extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NRings extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NumGeometries.php b/src/Functions/ST_NumGeometries.php index cde5a364..7ad51e49 100644 --- a/src/Functions/ST_NumGeometries.php +++ b/src/Functions/ST_NumGeometries.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NumGeometries extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NumGeometries extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NumInteriorRing.php b/src/Functions/ST_NumInteriorRing.php index f1b002e2..0cbcc9fa 100644 --- a/src/Functions/ST_NumInteriorRing.php +++ b/src/Functions/ST_NumInteriorRing.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NumInteriorRing extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NumInteriorRing extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NumInteriorRings.php b/src/Functions/ST_NumInteriorRings.php index 7434537f..c91b597c 100644 --- a/src/Functions/ST_NumInteriorRings.php +++ b/src/Functions/ST_NumInteriorRings.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NumInteriorRings extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NumInteriorRings extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NumPatches.php b/src/Functions/ST_NumPatches.php index d0badf4e..dc5dd88b 100644 --- a/src/Functions/ST_NumPatches.php +++ b/src/Functions/ST_NumPatches.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NumPatches extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NumPatches extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_NumPoints.php b/src/Functions/ST_NumPoints.php index 5b8e90f1..79381464 100644 --- a/src/Functions/ST_NumPoints.php +++ b/src/Functions/ST_NumPoints.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_NumPoints extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_NumPoints extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_OrderingEquals.php b/src/Functions/ST_OrderingEquals.php index 6f3785f8..98958a0b 100644 --- a/src/Functions/ST_OrderingEquals.php +++ b/src/Functions/ST_OrderingEquals.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_OrderingEquals extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_OrderingEquals extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Overlaps.php b/src/Functions/ST_Overlaps.php index 1fc9e274..87d85573 100644 --- a/src/Functions/ST_Overlaps.php +++ b/src/Functions/ST_Overlaps.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Overlaps extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Overlaps extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_PatchN.php b/src/Functions/ST_PatchN.php index d4f14629..3986cb24 100644 --- a/src/Functions/ST_PatchN.php +++ b/src/Functions/ST_PatchN.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_PatchN extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_PatchN extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Perimeter.php b/src/Functions/ST_Perimeter.php index bc1f20be..fea13acb 100644 --- a/src/Functions/ST_Perimeter.php +++ b/src/Functions/ST_Perimeter.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Perimeter extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_Perimeter extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Point.php b/src/Functions/ST_Point.php index 4c48e95a..417d0d92 100644 --- a/src/Functions/ST_Point.php +++ b/src/Functions/ST_Point.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Point extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Point extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_PointFromGeoHash.php b/src/Functions/ST_PointFromGeoHash.php index 08bc3ee9..ec5a6d4a 100644 --- a/src/Functions/ST_PointFromGeoHash.php +++ b/src/Functions/ST_PointFromGeoHash.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_PointFromGeoHash extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_PointFromGeoHash extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_PointFromText.php b/src/Functions/ST_PointFromText.php index 232242da..5d7806ec 100644 --- a/src/Functions/ST_PointFromText.php +++ b/src/Functions/ST_PointFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_PointFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_PointFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_PointFromWKB.php b/src/Functions/ST_PointFromWKB.php index 1a85611a..8dd61625 100644 --- a/src/Functions/ST_PointFromWKB.php +++ b/src/Functions/ST_PointFromWKB.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_PointFromWKB extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_PointFromWKB extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_PointN.php b/src/Functions/ST_PointN.php index 08f0ba95..36f35b0d 100644 --- a/src/Functions/ST_PointN.php +++ b/src/Functions/ST_PointN.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_PointN extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_PointN extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_PointOnSurface.php b/src/Functions/ST_PointOnSurface.php index 05a0796e..f71e6af8 100644 --- a/src/Functions/ST_PointOnSurface.php +++ b/src/Functions/ST_PointOnSurface.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_PointOnSurface extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_PointOnSurface extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Polygon.php b/src/Functions/ST_Polygon.php index a3e0e8ae..1acc1f12 100644 --- a/src/Functions/ST_Polygon.php +++ b/src/Functions/ST_Polygon.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Polygon extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Polygon extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_PolygonFromText.php b/src/Functions/ST_PolygonFromText.php index 403c7a12..3547eca1 100644 --- a/src/Functions/ST_PolygonFromText.php +++ b/src/Functions/ST_PolygonFromText.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_PolygonFromText extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_PolygonFromText extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Project.php b/src/Functions/ST_Project.php index d4b34e84..23087289 100644 --- a/src/Functions/ST_Project.php +++ b/src/Functions/ST_Project.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Project extends FunctionNode { @@ -18,20 +18,20 @@ final class ST_Project extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Relate.php b/src/Functions/ST_Relate.php index 0e9184f9..1047eaa6 100644 --- a/src/Functions/ST_Relate.php +++ b/src/Functions/ST_Relate.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Relate extends FunctionNode { @@ -18,23 +18,23 @@ final class ST_Relate extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_SRID.php b/src/Functions/ST_SRID.php index cf28188e..b1c5e4bb 100644 --- a/src/Functions/ST_SRID.php +++ b/src/Functions/ST_SRID.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_SRID extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_SRID extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Scale.php b/src/Functions/ST_Scale.php index 916a0297..f642eee4 100644 --- a/src/Functions/ST_Scale.php +++ b/src/Functions/ST_Scale.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Scale extends FunctionNode { @@ -18,27 +18,27 @@ final class ST_Scale extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_SetSRID.php b/src/Functions/ST_SetSRID.php index 60a65049..f02e1400 100644 --- a/src/Functions/ST_SetSRID.php +++ b/src/Functions/ST_SetSRID.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_SetSRID extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_SetSRID extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_ShiftLongitude.php b/src/Functions/ST_ShiftLongitude.php index ca2c3888..62d34be3 100644 --- a/src/Functions/ST_ShiftLongitude.php +++ b/src/Functions/ST_ShiftLongitude.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_ShiftLongitude extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_ShiftLongitude extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_ShortestLine.php b/src/Functions/ST_ShortestLine.php index 10a27bdb..f7dbdd62 100644 --- a/src/Functions/ST_ShortestLine.php +++ b/src/Functions/ST_ShortestLine.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_ShortestLine extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_ShortestLine extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_SnapToGrid.php b/src/Functions/ST_SnapToGrid.php index a2b2e768..33f25330 100644 --- a/src/Functions/ST_SnapToGrid.php +++ b/src/Functions/ST_SnapToGrid.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_SnapToGrid extends FunctionNode { @@ -18,38 +18,38 @@ final class ST_SnapToGrid extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Split.php b/src/Functions/ST_Split.php index 471cbece..215c73b3 100644 --- a/src/Functions/ST_Split.php +++ b/src/Functions/ST_Split.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Split extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Split extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_StartPoint.php b/src/Functions/ST_StartPoint.php index 52216522..39bdce89 100644 --- a/src/Functions/ST_StartPoint.php +++ b/src/Functions/ST_StartPoint.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_StartPoint extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_StartPoint extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Summary.php b/src/Functions/ST_Summary.php index a5a7e2e3..ebd666d0 100644 --- a/src/Functions/ST_Summary.php +++ b/src/Functions/ST_Summary.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Summary extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Summary extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_SymDifference.php b/src/Functions/ST_SymDifference.php index a2111ddf..0b82f3ab 100644 --- a/src/Functions/ST_SymDifference.php +++ b/src/Functions/ST_SymDifference.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_SymDifference extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_SymDifference extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Touches.php b/src/Functions/ST_Touches.php index dd13f0d9..a0dc23fc 100644 --- a/src/Functions/ST_Touches.php +++ b/src/Functions/ST_Touches.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Touches extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Touches extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_TransScale.php b/src/Functions/ST_TransScale.php index 5e984aab..8cf46374 100644 --- a/src/Functions/ST_TransScale.php +++ b/src/Functions/ST_TransScale.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_TransScale extends FunctionNode { @@ -18,28 +18,28 @@ final class ST_TransScale extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Transform.php b/src/Functions/ST_Transform.php index 01c2b96e..faee9975 100644 --- a/src/Functions/ST_Transform.php +++ b/src/Functions/ST_Transform.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Transform extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Transform extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Translate.php b/src/Functions/ST_Translate.php index 2f8bfebb..ca1e1b3e 100644 --- a/src/Functions/ST_Translate.php +++ b/src/Functions/ST_Translate.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Translate extends FunctionNode { @@ -18,27 +18,27 @@ final class ST_Translate extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Union.php b/src/Functions/ST_Union.php index 7c09556d..d4519cbf 100644 --- a/src/Functions/ST_Union.php +++ b/src/Functions/ST_Union.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Union extends FunctionNode { @@ -18,19 +18,19 @@ final class ST_Union extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Within.php b/src/Functions/ST_Within.php index a66ffe78..33dd7c17 100644 --- a/src/Functions/ST_Within.php +++ b/src/Functions/ST_Within.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Within extends FunctionNode { @@ -18,16 +18,16 @@ final class ST_Within extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_X.php b/src/Functions/ST_X.php index b0676049..eab84545 100644 --- a/src/Functions/ST_X.php +++ b/src/Functions/ST_X.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_X extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_X extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_XMax.php b/src/Functions/ST_XMax.php index d6524c37..95301f7c 100644 --- a/src/Functions/ST_XMax.php +++ b/src/Functions/ST_XMax.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_XMax extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_XMax extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_XMin.php b/src/Functions/ST_XMin.php index fb7781ad..0e13605a 100644 --- a/src/Functions/ST_XMin.php +++ b/src/Functions/ST_XMin.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_XMin extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_XMin extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Y.php b/src/Functions/ST_Y.php index fe6ffefe..287258a0 100644 --- a/src/Functions/ST_Y.php +++ b/src/Functions/ST_Y.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Y extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Y extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_YMax.php b/src/Functions/ST_YMax.php index efd09f14..fcb0bf14 100644 --- a/src/Functions/ST_YMax.php +++ b/src/Functions/ST_YMax.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_YMax extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_YMax extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_YMin.php b/src/Functions/ST_YMin.php index 8b14eda0..ce7b83cd 100644 --- a/src/Functions/ST_YMin.php +++ b/src/Functions/ST_YMin.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_YMin extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_YMin extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Z.php b/src/Functions/ST_Z.php index 33b4358d..65bcaa84 100644 --- a/src/Functions/ST_Z.php +++ b/src/Functions/ST_Z.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Z extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Z extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_ZMax.php b/src/Functions/ST_ZMax.php index 63cd9071..82e255fc 100644 --- a/src/Functions/ST_ZMax.php +++ b/src/Functions/ST_ZMax.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_ZMax extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_ZMax extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_ZMin.php b/src/Functions/ST_ZMin.php index 9808b113..ad4f7e63 100644 --- a/src/Functions/ST_ZMin.php +++ b/src/Functions/ST_ZMin.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_ZMin extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_ZMin extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Functions/ST_Zmflag.php b/src/Functions/ST_Zmflag.php index 695681bc..7701ec7b 100644 --- a/src/Functions/ST_Zmflag.php +++ b/src/Functions/ST_Zmflag.php @@ -8,9 +8,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use Doctrine\ORM\Query\TokenType; final class ST_Zmflag extends FunctionNode { @@ -18,12 +18,12 @@ final class ST_Zmflag extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); $this->expressions[] = $parser->ArithmeticFactor(); - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string diff --git a/tools/generate-functions.php b/tools/generate-functions.php index 5108d7ee..11c8e16e 100644 --- a/tools/generate-functions.php +++ b/tools/generate-functions.php @@ -74,7 +74,7 @@ function get_function_src_class_code($name, $options) use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; -use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\TokenType; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; @@ -84,13 +84,13 @@ final class extends FunctionNode public function parse(Parser $parser): void { - $parser->match(Lexer::T_IDENTIFIER); - $parser->match(Lexer::T_OPEN_PARENTHESIS); + $parser->match(TokenType::T_IDENTIFIER); + $parser->match(TokenType::T_OPEN_PARENTHESIS); 0) { ?> 0) { ?> - $parser->match(Lexer::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); @@ -101,14 +101,14 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); - if ($lexer->isNextToken(Lexer::T_COMMA)) { - $parser->match(Lexer::T_COMMA); + if ($lexer->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $this->expressions[] = $parser->ArithmeticFactor(); } - $parser->match(Lexer::T_CLOSE_PARENTHESIS); + $parser->match(TokenType::T_CLOSE_PARENTHESIS); } public function getSql(SqlWalker $sqlWalker): string From 7fb909148fe703a5d295f51ff71a6a571c57a769 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Thu, 7 Mar 2024 17:06:43 +0100 Subject: [PATCH 10/19] Update minimum required versions --- composer.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index b91a2fe7..2e52805f 100644 --- a/composer.json +++ b/composer.json @@ -23,15 +23,16 @@ ], "require": { "php": "^8.0", - "doctrine/dbal": "^3.2" + "doctrine/dbal": "^3.7 || ^4.0" }, "require-dev": { - "doctrine/orm": "^2.9", + "doctrine/collections": "^2.0 || ^3.0", + "doctrine/orm": "^2.19 || ^3.0", "friendsofphp/php-cs-fixer": "^3.13", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6", "vimeo/psalm": "^5.9", - "symfony/doctrine-bridge": "^5.4 || ^6.0", - "symfony/doctrine-messenger": "^5.4 || ^6.0" + "symfony/doctrine-bridge": "^6.4", + "symfony/doctrine-messenger": "^6.4" }, "suggest": { "doctrine/orm": "For using with the Doctrine ORM" From 07e9d7a70a74db85dd1e1e2b468ab150c5504c88 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Thu, 7 Mar 2024 17:07:21 +0100 Subject: [PATCH 11/19] Update psalm baseline --- psalm-baseline.xml | 3003 +++++++++++++++++++++++++++++--------------- 1 file changed, 2009 insertions(+), 994 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index b30f6972..b5c62589 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,1297 +1,2312 @@ - - - addSql( - $spatialIndexSqlGenerator->getSql($index, $table) - )]]> - setColumn($column)]]> - setIndex($spatialIndex)]]> - addSql($sql)]]> - addSql(sprintf( - "SELECT UpdateGeometrySRID('%s', '%s', %d)", - $table->getName(), - $column->getName(), - (int) $column->getPlatformOption('srid') - ))]]> - preventDefault()]]> - - - - - - - - - - - - - - - - - - - - - name]]> - name]]> - newName]]> - newName]]> - newName]]> - newName]]> - - - column]]> - fromColumn]]> - fromColumn]]> - addedIndexes]]> - addedIndexes]]> - changedIndexes]]> - changedIndexes]]> - removedIndexes]]> - + + + + - + - - - + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + _conn]]> + + + _conn]]> + + + + + getCreatedTables(), + array_map($filter, $schemaDiff->getAlteredTables()), + $schemaDiff->getDroppedTables(), + $schemaDiff->fromSchema, + $schemaDiff->getCreatedSchemas(), + $schemaDiff->getDroppedSchemas(), + $schemaDiff->getCreatedSequences(), + $schemaDiff->getAlteredSequences(), + $schemaDiff->getDroppedSequences(), + )]]> + getCreatedSchemas(), + $schemaDiff->getDroppedSchemas(), + $schemaDiff->getCreatedTables(), + array_map($filter, $schemaDiff->getAlteredTables()), + $schemaDiff->getDroppedTables(), + $schemaDiff->getCreatedSequences(), + $schemaDiff->getAlteredSequences(), + $schemaDiff->getDroppedSequences(), + )]]> + getOldTable()?->getName(), + $tableDiff->getAddedColumns(), + $tableDiff->getModifiedColumns(), + $tableDiff->getDroppedColumns(), + array_filter($tableDiff->getAddedIndexes(), $spatialFilter), + array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), + $tableDiff->getDroppedIndexes(), + $tableDiff->getOldTable(), + $tableDiff->getAddedForeignKeys(), + $tableDiff->getModifiedForeignKeys(), + $tableDiff->getDroppedForeignKeys(), + $tableDiff->getRenamedColumns(), + $tableDiff->getRenamedIndexes(), + )]]> + getOldTable(), + $tableDiff->getAddedColumns(), + $tableDiff->getModifiedColumns(), + $tableDiff->getDroppedColumns(), + $tableDiff->getRenamedColumns(), + array_filter($tableDiff->getAddedIndexes(), $spatialFilter), + array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), + $tableDiff->getDroppedIndexes(), + $tableDiff->getRenamedIndexes(), + $tableDiff->getAddedForeignKeys(), + $tableDiff->getModifiedForeignKeys(), + $tableDiff->getDroppedForeignKeys(), + )]]> + + + getCreatedSchemas()]]> + getCreatedTables()]]> + getDroppedSchemas()]]> + getAddedForeignKeys()]]> + getOldTable()]]> + getRenamedColumns()]]> + getOldTable()?->getName()]]> + getAddedIndexes(), $spatialFilter)]]> + getAlteredTables())]]> + + + fromSchema]]> + + + + $idx->hasFlag('spatial'))]]> + + + getOldTable()?->getName()]]> + + + getCreatedTables(), + array_map($filter, $schemaDiff->getAlteredTables()), + $schemaDiff->getDroppedTables(), + $schemaDiff->fromSchema, + $schemaDiff->getCreatedSchemas(), + $schemaDiff->getDroppedSchemas(), + $schemaDiff->getCreatedSequences(), + $schemaDiff->getAlteredSequences(), + $schemaDiff->getDroppedSequences(), + )]]> + getOldTable()?->getName(), + $tableDiff->getAddedColumns(), + $tableDiff->getModifiedColumns(), + $tableDiff->getDroppedColumns(), + array_filter($tableDiff->getAddedIndexes(), $spatialFilter), + array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), + $tableDiff->getDroppedIndexes(), + $tableDiff->getOldTable(), + $tableDiff->getAddedForeignKeys(), + $tableDiff->getModifiedForeignKeys(), + $tableDiff->getDroppedForeignKeys(), + $tableDiff->getRenamedColumns(), + $tableDiff->getRenamedIndexes(), + )]]> + + + getOldTable()]]> + + + + + + + fromSchema]]> + From 1dea92f9a1132e21b5e99e9c99f5204c3cfce93b Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Fri, 8 Mar 2024 12:12:00 +0100 Subject: [PATCH 12/19] Check platform option exists before use --- src/Driver/PostGISPlatform.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Driver/PostGISPlatform.php b/src/Driver/PostGISPlatform.php index c417b03f..4a4c788d 100644 --- a/src/Driver/PostGISPlatform.php +++ b/src/Driver/PostGISPlatform.php @@ -124,12 +124,21 @@ public function getAlterTableSQL(TableDiff $diff): array /** @var ColumnDiff $columnDiff */ foreach ($diff->getModifiedColumns() as $columnDiff) { - if ($columnDiff->getOldColumn()->getPlatformOption('srid') !== $columnDiff->getNewColumn()->getPlatformOption('srid')) { + $oldColumn = $columnDiff->getOldColumn(); + $newColumn = $columnDiff->getNewColumn(); + $oldSrid = $oldColumn->hasPlatformOption('srid') ? $oldColumn->getPlatformOption('srid') : null; + $newSrid = $newColumn->hasPlatformOption('srid') ? $newColumn->getPlatformOption('srid') : null; + + if (!$oldSrid && !$newSrid) { + continue; + } + + if ($newSrid !== null && $oldSrid !== $newSrid) { $sql[] = sprintf( "SELECT UpdateGeometrySRID('%s', '%s', %d)", $table->getName(), - $columnDiff->getNewColumn()->getName(), - (int) $columnDiff->getNewColumn()->getPlatformOption('srid') + $newColumn->getName(), + (int) $newSrid ); } } From c2b86ffd39ddb7f8d4ea650e25cbda9dd4d7ea38 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Tue, 23 Apr 2024 12:13:47 +0200 Subject: [PATCH 13/19] Update docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a9d05488..686a709a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver\PgSQL\Driver; use Jsor\Doctrine\PostGIS\Driver\Middleware; -use Jsor\Doctrine\PostGIS\Event\ORMSchemaEventSubscriber; +use Jsor\Doctrine\PostGIS\Event\ORMSchemaEventListener; use Jsor\Doctrine\PostGIS\Schema\SchemaManagerFactory; $params = [ @@ -73,9 +73,10 @@ Additionally, to also use the library with the Doctrine ORM, register the `ORMSchemaEventListener` event subscriber. ```php +use Doctrine\ORM\Tools\ToolEvents; use Jsor\Doctrine\PostGIS\Event\ORMSchemaEventListener; -$entityManager->getEventManager()->addEventSubscriber(new ORMSchemaEventSubscriber()); +$entityManager->getEventManager()->addEventListener(ToolEvents::postGenerateSchemaTable, new ORMSchemaEventListener()); ``` ### Symfony From 9a88d1f66372e51bcd5b92fdef3a03306096a293 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Tue, 23 Apr 2024 12:14:36 +0200 Subject: [PATCH 14/19] Raise Docker PHP version to 8.2 --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9322e373..03c04f5a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-cli-alpine AS php +FROM php:8.2-cli-alpine AS php RUN apk add --no-cache \ git \ From 69c3ad62cab200b10d60dd6bf920da3c4c239f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20H=C3=A9lias?= Date: Thu, 25 Sep 2025 17:49:15 +0200 Subject: [PATCH 15/19] feat: add doctrine/orm <2.18 in conflict --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 2e52805f..76256483 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,9 @@ "symfony/doctrine-bridge": "^6.4", "symfony/doctrine-messenger": "^6.4" }, + "conflict": { + "doctrine/orm": "<2.18" + }, "suggest": { "doctrine/orm": "For using with the Doctrine ORM" }, From ea4e3737a1e4e8feb17d060747d0841bb39595a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20H=C3=A9lias?= Date: Thu, 25 Sep 2025 18:15:24 +0200 Subject: [PATCH 16/19] feat: csfixer --- composer.json | 2 +- src/Driver/PostGISPlatform.php | 4 +++- src/Schema/SchemaManager.php | 2 +- src/Types/GeographyType.php | 2 ++ src/Types/PostGISType.php | 2 ++ tests/Functions/GeographyTest.php | 4 ++-- tests/Functions/GeometryTest.php | 4 ++-- tests/Functions/GeometryTypeTest.php | 4 ++-- tests/Functions/ST_3DClosestPointTest.php | 8 ++++---- tests/Functions/ST_3DDFullyWithinTest.php | 4 ++-- tests/Functions/ST_3DDWithinTest.php | 4 ++-- tests/Functions/ST_3DDistanceTest.php | 4 ++-- tests/Functions/ST_3DIntersectsTest.php | 4 ++-- tests/Functions/ST_3DLengthTest.php | 4 ++-- tests/Functions/ST_3DLongestLineTest.php | 4 ++-- tests/Functions/ST_3DMakeBoxTest.php | 4 ++-- tests/Functions/ST_3DMaxDistanceTest.php | 4 ++-- tests/Functions/ST_3DShortestLineTest.php | 8 ++++---- tests/Functions/ST_AddPointTest.php | 6 +++--- tests/Functions/ST_AreaTest.php | 8 ++++---- tests/Functions/ST_AsBinaryTest.php | 8 ++++---- tests/Functions/ST_AsEWKBTest.php | 8 ++++---- tests/Functions/ST_AsEWKTTest.php | 8 ++++---- tests/Functions/ST_AsGMLTest.php | 8 ++++---- tests/Functions/ST_AsGeoJSONTest.php | 8 ++++---- tests/Functions/ST_AsHEXEWKBTest.php | 8 ++++---- tests/Functions/ST_AsLatLonTextTest.php | 8 ++++---- tests/Functions/ST_AsSVGTest.php | 8 ++++---- tests/Functions/ST_AsTextTest.php | 4 ++-- tests/Functions/ST_AzimuthTest.php | 4 ++-- tests/Functions/ST_BoundaryTest.php | 4 ++-- tests/Functions/ST_Box2dFromGeoHashTest.php | 20 +++++++++---------- tests/Functions/ST_BufferTest.php | 14 ++++++------- tests/Functions/ST_CentroidTest.php | 8 ++++---- tests/Functions/ST_ClosestPointTest.php | 4 ++-- tests/Functions/ST_CollectTest.php | 4 ++-- tests/Functions/ST_ContainsProperlyTest.php | 4 ++-- tests/Functions/ST_ContainsTest.php | 4 ++-- tests/Functions/ST_CoordDimTest.php | 4 ++-- tests/Functions/ST_CoveredByTest.php | 4 ++-- tests/Functions/ST_CoversTest.php | 4 ++-- tests/Functions/ST_CrossesTest.php | 4 ++-- tests/Functions/ST_DFullyWithinTest.php | 4 ++-- tests/Functions/ST_DWithinTest.php | 4 ++-- tests/Functions/ST_DifferenceTest.php | 4 ++-- tests/Functions/ST_DimensionTest.php | 4 ++-- tests/Functions/ST_DisjointTest.php | 4 ++-- tests/Functions/ST_DistanceSphereTest.php | 4 ++-- tests/Functions/ST_DistanceSpheroidTest.php | 4 ++-- tests/Functions/ST_DistanceTest.php | 8 ++++---- tests/Functions/ST_EndPointTest.php | 8 ++++---- tests/Functions/ST_EnvelopeTest.php | 4 ++-- tests/Functions/ST_EqualsTest.php | 4 ++-- tests/Functions/ST_ExtentTest.php | 4 ++-- tests/Functions/ST_ExteriorRingTest.php | 4 ++-- tests/Functions/ST_FlipCoordinatesTest.php | 4 ++-- tests/Functions/ST_GeoHashTest.php | 8 ++++---- tests/Functions/ST_GeogFromTextTest.php | 4 ++-- tests/Functions/ST_GeogFromWKBTest.php | 4 ++-- tests/Functions/ST_GeographyFromTextTest.php | 4 ++-- tests/Functions/ST_GeomCollFromTextTest.php | 8 ++++---- tests/Functions/ST_GeomFromEWKBTest.php | 4 ++-- tests/Functions/ST_GeomFromEWKTTest.php | 4 ++-- tests/Functions/ST_GeomFromGMLTest.php | 12 +++++------ tests/Functions/ST_GeomFromGeoHashTest.php | 12 +++++------ tests/Functions/ST_GeomFromGeoJSONTest.php | 8 ++++---- tests/Functions/ST_GeomFromKMLTest.php | 4 ++-- tests/Functions/ST_GeomFromTextTest.php | 8 ++++---- tests/Functions/ST_GeomFromWKBTest.php | 4 ++-- tests/Functions/ST_GeometryFromTextTest.php | 8 ++++---- tests/Functions/ST_GeometryNTest.php | 4 ++-- tests/Functions/ST_GeometryTypeTest.php | 4 ++-- tests/Functions/ST_HasArcTest.php | 4 ++-- tests/Functions/ST_HausdorffDistanceTest.php | 4 ++-- tests/Functions/ST_InteriorRingNTest.php | 8 ++++---- tests/Functions/ST_IntersectionTest.php | 4 ++-- tests/Functions/ST_IntersectsTest.php | 8 ++++---- tests/Functions/ST_IsClosedTest.php | 8 ++++---- tests/Functions/ST_IsCollectionTest.php | 8 ++++---- tests/Functions/ST_IsEmptyTest.php | 8 ++++---- tests/Functions/ST_IsRingTest.php | 8 ++++---- tests/Functions/ST_IsSimpleTest.php | 8 ++++---- tests/Functions/ST_IsValidDetailTest.php | 8 ++++---- tests/Functions/ST_IsValidReasonTest.php | 8 ++++---- tests/Functions/ST_IsValidTest.php | 12 +++++------ tests/Functions/ST_LengthSpheroidTest.php | 4 ++-- tests/Functions/ST_LengthTest.php | 8 ++++---- .../ST_LineCrossingDirectionTest.php | 4 ++-- tests/Functions/ST_LineFromMultiPointTest.php | 4 ++-- tests/Functions/ST_LineFromTextTest.php | 8 ++++---- tests/Functions/ST_LineFromWKBTest.php | 8 ++++---- tests/Functions/ST_LinestringFromWKBTest.php | 8 ++++---- tests/Functions/ST_LongestLineTest.php | 4 ++-- tests/Functions/ST_MLineFromTextTest.php | 8 ++++---- tests/Functions/ST_MPointFromTextTest.php | 8 ++++---- tests/Functions/ST_MPolyFromTextTest.php | 8 ++++---- tests/Functions/ST_MTest.php | 4 ++-- tests/Functions/ST_MakeBox2DTest.php | 4 ++-- tests/Functions/ST_MakeEnvelopeTest.php | 4 ++-- tests/Functions/ST_MakeLineTest.php | 4 ++-- tests/Functions/ST_MakePointMTest.php | 4 ++-- tests/Functions/ST_MakePointTest.php | 4 ++-- tests/Functions/ST_MakePolygonTest.php | 4 ++-- tests/Functions/ST_MaxDistanceTest.php | 4 ++-- .../ST_MinimumBoundingCircleTest.php | 8 ++++---- tests/Functions/ST_MultiTest.php | 4 ++-- tests/Functions/ST_NDimsTest.php | 8 ++++---- tests/Functions/ST_NPointsTest.php | 8 ++++---- tests/Functions/ST_NRingsTest.php | 4 ++-- tests/Functions/ST_NumGeometriesTest.php | 8 ++++---- tests/Functions/ST_NumInteriorRingTest.php | 4 ++-- tests/Functions/ST_NumInteriorRingsTest.php | 4 ++-- tests/Functions/ST_NumPatchesTest.php | 4 ++-- tests/Functions/ST_NumPointsTest.php | 4 ++-- tests/Functions/ST_OrderingEqualsTest.php | 4 ++-- tests/Functions/ST_OverlapsTest.php | 4 ++-- tests/Functions/ST_PatchNTest.php | 4 ++-- tests/Functions/ST_PerimeterTest.php | 8 ++++---- tests/Functions/ST_PointFromGeoHashTest.php | 12 +++++------ tests/Functions/ST_PointFromTextTest.php | 4 ++-- tests/Functions/ST_PointFromWKBTest.php | 4 ++-- tests/Functions/ST_PointNTest.php | 4 ++-- tests/Functions/ST_PointOnSurfaceTest.php | 4 ++-- tests/Functions/ST_PointTest.php | 4 ++-- tests/Functions/ST_PolygonFromTextTest.php | 4 ++-- tests/Functions/ST_PolygonTest.php | 4 ++-- tests/Functions/ST_ProjectTest.php | 6 +++--- tests/Functions/ST_RelateTest.php | 4 ++-- tests/Functions/ST_SRIDTest.php | 4 ++-- tests/Functions/ST_ScaleTest.php | 4 ++-- tests/Functions/ST_SetSRIDTest.php | 4 ++-- tests/Functions/ST_ShiftLongitudeTest.php | 8 ++++---- tests/Functions/ST_ShortestLineTest.php | 8 ++++---- tests/Functions/ST_SnapToGridTest.php | 8 ++++---- tests/Functions/ST_SplitTest.php | 8 ++++---- tests/Functions/ST_StartPointTest.php | 4 ++-- tests/Functions/ST_SummaryTest.php | 4 ++-- tests/Functions/ST_SymDifferenceTest.php | 4 ++-- tests/Functions/ST_TouchesTest.php | 4 ++-- tests/Functions/ST_TransScaleTest.php | 4 ++-- tests/Functions/ST_TransformTest.php | 8 ++++---- tests/Functions/ST_TranslateTest.php | 4 ++-- tests/Functions/ST_UnionTest.php | 4 ++-- tests/Functions/ST_WithinTest.php | 4 ++-- tests/Functions/ST_XMaxTest.php | 4 ++-- tests/Functions/ST_XMinTest.php | 4 ++-- tests/Functions/ST_XTest.php | 4 ++-- tests/Functions/ST_YMaxTest.php | 4 ++-- tests/Functions/ST_YMinTest.php | 4 ++-- tests/Functions/ST_YTest.php | 4 ++-- tests/Functions/ST_ZMaxTest.php | 4 ++-- tests/Functions/ST_ZMinTest.php | 4 ++-- tests/Functions/ST_ZTest.php | 4 ++-- tests/Functions/ST_ZmflagTest.php | 8 ++++---- tests/Types/AbstractTypeTestCase.php | 2 ++ tests/fixtures/Types/GeoJsonType.php | 2 ++ 156 files changed, 434 insertions(+), 424 deletions(-) diff --git a/composer.json b/composer.json index 76256483..bf8ec627 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "doctrine/dbal": "^3.7 || ^4.0" }, "require-dev": { diff --git a/src/Driver/PostGISPlatform.php b/src/Driver/PostGISPlatform.php index 4a4c788d..99d5e856 100644 --- a/src/Driver/PostGISPlatform.php +++ b/src/Driver/PostGISPlatform.php @@ -15,6 +15,8 @@ use Jsor\Doctrine\PostGIS\Schema\SpatialIndexes; use Jsor\Doctrine\PostGIS\Schema\SpatialIndexSqlGenerator; +use function sprintf; + final class PostGISPlatform extends PostgreSQLPlatform { public function createSchemaManager(Connection $connection): PostgreSQLSchemaManager @@ -133,7 +135,7 @@ public function getAlterTableSQL(TableDiff $diff): array continue; } - if ($newSrid !== null && $oldSrid !== $newSrid) { + if (null !== $newSrid && $oldSrid !== $newSrid) { $sql[] = sprintf( "SELECT UpdateGeometrySRID('%s', '%s', %d)", $table->getName(), diff --git a/src/Schema/SchemaManager.php b/src/Schema/SchemaManager.php index 38b5d035..e5edac40 100644 --- a/src/Schema/SchemaManager.php +++ b/src/Schema/SchemaManager.php @@ -231,7 +231,7 @@ protected function resolveSpatialColumnInfo(Column $column, string $tableName): default => null, }; - if ($info === null) { + if (null === $info) { return; } diff --git a/src/Types/GeographyType.php b/src/Types/GeographyType.php index 6cb31972..1fdd892c 100644 --- a/src/Types/GeographyType.php +++ b/src/Types/GeographyType.php @@ -6,6 +6,8 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; +use function sprintf; + class GeographyType extends PostGISType { public function getName(): string diff --git a/src/Types/PostGISType.php b/src/Types/PostGISType.php index d0b73087..18a9d836 100644 --- a/src/Types/PostGISType.php +++ b/src/Types/PostGISType.php @@ -7,6 +7,8 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Type; +use function sprintf; + abstract class PostGISType extends Type { public const GEOMETRY = 'geometry'; diff --git a/tests/Functions/GeographyTest.php b/tests/Functions/GeographyTest.php index 9e25e948..d91d02b5 100644 --- a/tests/Functions/GeographyTest.php +++ b/tests/Functions/GeographyTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/GeometryTest.php b/tests/Functions/GeometryTest.php index daeb7381..0d9e6130 100644 --- a/tests/Functions/GeometryTest.php +++ b/tests/Functions/GeometryTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/GeometryTypeTest.php b/tests/Functions/GeometryTypeTest.php index 059edfeb..8a4e1a2f 100644 --- a/tests/Functions/GeometryTypeTest.php +++ b/tests/Functions/GeometryTypeTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING', -]; + 'value' => 'LINESTRING', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DClosestPointTest.php b/tests/Functions/ST_3DClosestPointTest.php index fc0772b5..3d57f882 100644 --- a/tests/Functions/ST_3DClosestPointTest.php +++ b/tests/Functions/ST_3DClosestPointTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(54.6993798867619 128.935022917228 11.5475869506606)', -]; + 'value' => 'POINT(54.6993798867619 128.935022917228 11.5475869506606)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POINT(54.69937988676193 128.93502291722837 11.547586950660556)', -]; + 'value' => 'POINT(54.69937988676193 128.93502291722837 11.547586950660556)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DDFullyWithinTest.php b/tests/Functions/ST_3DDFullyWithinTest.php index b8d4616e..cdaa3452 100644 --- a/tests/Functions/ST_3DDFullyWithinTest.php +++ b/tests/Functions/ST_3DDFullyWithinTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DDWithinTest.php b/tests/Functions/ST_3DDWithinTest.php index 97e676c5..374625c1 100644 --- a/tests/Functions/ST_3DDWithinTest.php +++ b/tests/Functions/ST_3DDWithinTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DDistanceTest.php b/tests/Functions/ST_3DDistanceTest.php index 2c62771a..0409cbc7 100644 --- a/tests/Functions/ST_3DDistanceTest.php +++ b/tests/Functions/ST_3DDistanceTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1.73205080756888, -]; + 'value' => 1.73205080756888, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DIntersectsTest.php b/tests/Functions/ST_3DIntersectsTest.php index 72e87213..4e976979 100644 --- a/tests/Functions/ST_3DIntersectsTest.php +++ b/tests/Functions/ST_3DIntersectsTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DLengthTest.php b/tests/Functions/ST_3DLengthTest.php index 9617fed8..9f212731 100644 --- a/tests/Functions/ST_3DLengthTest.php +++ b/tests/Functions/ST_3DLengthTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 122.704716741457, -]; + 'value' => 122.704716741457, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DLongestLineTest.php b/tests/Functions/ST_3DLongestLineTest.php index 7fd4cdfd..c3f7be19 100644 --- a/tests/Functions/ST_3DLongestLineTest.php +++ b/tests/Functions/ST_3DLongestLineTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(50 75 1000,100 100 30)', -]; + 'value' => 'LINESTRING(50 75 1000,100 100 30)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DMakeBoxTest.php b/tests/Functions/ST_3DMakeBoxTest.php index 3d4aeeb3..fdbe9f12 100644 --- a/tests/Functions/ST_3DMakeBoxTest.php +++ b/tests/Functions/ST_3DMakeBoxTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'BOX3D(-989502.1875 528439.5625 10,-987121.375 529933.1875 10)', -]; + 'value' => 'BOX3D(-989502.1875 528439.5625 10,-987121.375 529933.1875 10)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DMaxDistanceTest.php b/tests/Functions/ST_3DMaxDistanceTest.php index 6c99f26c..9fbd56ad 100644 --- a/tests/Functions/ST_3DMaxDistanceTest.php +++ b/tests/Functions/ST_3DMaxDistanceTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1.73205080756888, -]; + 'value' => 1.73205080756888, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_3DShortestLineTest.php b/tests/Functions/ST_3DShortestLineTest.php index 485f6757..f3d6f50d 100644 --- a/tests/Functions/ST_3DShortestLineTest.php +++ b/tests/Functions/ST_3DShortestLineTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(54.6993798867619 128.935022917228 11.5475869506606,100 100 30)', -]; + 'value' => 'LINESTRING(54.6993798867619 128.935022917228 11.5475869506606,100 100 30)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'LINESTRING(54.69937988676193 128.93502291722837 11.547586950660556,100 100 30)', -]; + 'value' => 'LINESTRING(54.69937988676193 128.93502291722837 11.547586950660556,100 100 30)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AddPointTest.php b/tests/Functions/ST_AddPointTest.php index 4f23ed18..4e647265 100644 --- a/tests/Functions/ST_AddPointTest.php +++ b/tests/Functions/ST_AddPointTest.php @@ -71,9 +71,9 @@ public function testQuery1(): void }); $expected = [ - 'value1' => 'LINESTRING(1.1115678 2.123,4.111111 3.2374897,4.11112 3.23748667,-123.365556 48.428611)', - 'value2' => 'LINESTRING(1.1115678 2.123,-123.365556 48.428611,4.111111 3.2374897,4.11112 3.23748667)', -]; + 'value1' => 'LINESTRING(1.1115678 2.123,4.111111 3.2374897,4.11112 3.23748667,-123.365556 48.428611)', + 'value2' => 'LINESTRING(1.1115678 2.123,-123.365556 48.428611,4.111111 3.2374897,4.11112 3.23748667)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AreaTest.php b/tests/Functions/ST_AreaTest.php index 4188cd45..2c2cd9de 100644 --- a/tests/Functions/ST_AreaTest.php +++ b/tests/Functions/ST_AreaTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 928.625, -]; + 'value' => 928.625, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 7635253966144.121, -]; + 'value' => 7635253966144.121, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsBinaryTest.php b/tests/Functions/ST_AsBinaryTest.php index d652ac6d..eb988e04 100644 --- a/tests/Functions/ST_AsBinaryTest.php +++ b/tests/Functions/ST_AsBinaryTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsEWKBTest.php b/tests/Functions/ST_AsEWKBTest.php index 418d3fd4..7cade8db 100644 --- a/tests/Functions/ST_AsEWKBTest.php +++ b/tests/Functions/ST_AsEWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsEWKTTest.php b/tests/Functions/ST_AsEWKTTest.php index 0de29e38..e5b15c1b 100644 --- a/tests/Functions/ST_AsEWKTTest.php +++ b/tests/Functions/ST_AsEWKTTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 150406 3)', -]; + 'value' => 'CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 150406 3)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsGMLTest.php b/tests/Functions/ST_AsGMLTest.php index d70de461..789d2231 100644 --- a/tests/Functions/ST_AsGMLTest.php +++ b/tests/Functions/ST_AsGMLTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0,0 0,1 1,1 1,0 0,0', -]; + 'value' => '0,0 0,1 1,1 1,0 0,0', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '6.34535 5.23423', -]; + 'value' => '6.34535 5.23423', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsGeoJSONTest.php b/tests/Functions/ST_AsGeoJSONTest.php index 800bbb92..3245fde3 100644 --- a/tests/Functions/ST_AsGeoJSONTest.php +++ b/tests/Functions/ST_AsGeoJSONTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '{"type":"LineString","coordinates":[[1,2,3],[4,5,6]]}', -]; + 'value' => '{"type":"LineString","coordinates":[[1,2,3],[4,5,6]]}', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[[1,2,3],[4,5,6]]}', -]; + 'value' => '{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[[1,2,3],[4,5,6]]}', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsHEXEWKBTest.php b/tests/Functions/ST_AsHEXEWKBTest.php index f3dd7cbf..d7132128 100644 --- a/tests/Functions/ST_AsHEXEWKBTest.php +++ b/tests/Functions/ST_AsHEXEWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0103000020E61000000100000005000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000000000000000000000000000000000000000', -]; + 'value' => '0103000020E61000000100000005000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000000000000000000000000000000000000000', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '0020000003000010E600000001000000050000000000000000000000000000000000000000000000003FF00000000000003FF00000000000003FF00000000000003FF0000000000000000000000000000000000000000000000000000000000000', -]; + 'value' => '0020000003000010E600000001000000050000000000000000000000000000000000000000000000003FF00000000000003FF00000000000003FF00000000000003FF0000000000000000000000000000000000000000000000000000000000000', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsLatLonTextTest.php b/tests/Functions/ST_AsLatLonTextTest.php index 435ef1d1..bac12ae8 100644 --- a/tests/Functions/ST_AsLatLonTextTest.php +++ b/tests/Functions/ST_AsLatLonTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '2°19\'29.928"S 3°14\'3.243"W', -]; + 'value' => '2°19\'29.928"S 3°14\'3.243"W', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '2°19\'29.928"S 3°14\'3.243"W', -]; + 'value' => '2°19\'29.928"S 3°14\'3.243"W', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsSVGTest.php b/tests/Functions/ST_AsSVGTest.php index 3ad1345c..4b73c453 100644 --- a/tests/Functions/ST_AsSVGTest.php +++ b/tests/Functions/ST_AsSVGTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'M 0 0 L 0 -1 1 -1 1 0 Z', -]; + 'value' => 'M 0 0 L 0 -1 1 -1 1 0 Z', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'x="5.23423" y="-6.34535"', -]; + 'value' => 'x="5.23423" y="-6.34535"', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AsTextTest.php b/tests/Functions/ST_AsTextTest.php index 3209dd10..6bebc59f 100644 --- a/tests/Functions/ST_AsTextTest.php +++ b/tests/Functions/ST_AsTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_AzimuthTest.php b/tests/Functions/ST_AzimuthTest.php index 2e1c595a..ef0ada9e 100644 --- a/tests/Functions/ST_AzimuthTest.php +++ b/tests/Functions/ST_AzimuthTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 0.737815060120465, -]; + 'value' => 0.737815060120465, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_BoundaryTest.php b/tests/Functions/ST_BoundaryTest.php index 8bbe6f47..a1288f80 100644 --- a/tests/Functions/ST_BoundaryTest.php +++ b/tests/Functions/ST_BoundaryTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'MULTIPOINT(1 1,-1 1)', -]; + 'value' => 'MULTIPOINT(1 1,-1 1)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_Box2dFromGeoHashTest.php b/tests/Functions/ST_Box2dFromGeoHashTest.php index c254c6cd..678fdedf 100644 --- a/tests/Functions/ST_Box2dFromGeoHashTest.php +++ b/tests/Functions/ST_Box2dFromGeoHashTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'BOX(-115.172816 36.114646,-115.172816 36.114646)', -]; + 'value' => 'BOX(-115.172816 36.114646,-115.172816 36.114646)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'BOX(-115.17281600000001 36.11464599999999,-115.172816 36.114646)', -]; + 'value' => 'BOX(-115.17281600000001 36.11464599999999,-115.172816 36.114646)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -131,8 +131,8 @@ public function testQuery3(): void }); $expected = [ - 'value' => 'BOX(-180 -90,180 90)', -]; + 'value' => 'BOX(-180 -90,180 90)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -161,8 +161,8 @@ public function testQuery4(): void }); $expected = [ - 'value' => 'BOX(-115.17282128334 36.1146408319473,-115.172810554504 36.1146461963654)', -]; + 'value' => 'BOX(-115.17282128334 36.1146408319473,-115.172810554504 36.1146461963654)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -191,8 +191,8 @@ public function testQuery5(): void }); $expected = [ - 'value' => 'BOX(-115.17282128334045 36.11464083194733,-115.1728105545044 36.114646196365356)', -]; + 'value' => 'BOX(-115.17282128334045 36.11464083194733,-115.1728105545044 36.114646196365356)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_BufferTest.php b/tests/Functions/ST_BufferTest.php index 3bd29239..3b352625 100644 --- a/tests/Functions/ST_BufferTest.php +++ b/tests/Functions/ST_BufferTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((150 90,149.039264020162 80.2454838991936,146.193976625564 70.8658283817455,141.573480615127 62.2214883490199,135.355339059327 54.6446609406727,127.77851165098 48.4265193848728,119.134171618255 43.8060233744357,109.754516100806 40.9607359798385,100 40,90.2454838991937 40.9607359798385,80.8658283817456 43.8060233744356,72.22148834902 48.4265193848727,64.6446609406727 54.6446609406725,58.4265193848728 62.2214883490198,53.8060233744357 70.8658283817454,50.9607359798385 80.2454838991934,50 89.9999999999998,50.9607359798384 99.7545161008062,53.8060233744356 109.134171618254,58.4265193848726 117.77851165098,64.6446609406725 125.355339059327,72.2214883490197 131.573480615127,80.8658283817453 136.193976625564,90.2454838991934 139.039264020161,99.9999999999998 140,109.754516100806 139.039264020162,119.134171618254 136.193976625564,127.77851165098 131.573480615127,135.355339059327 125.355339059327,141.573480615127 117.77851165098,146.193976625564 109.134171618255,149.039264020162 99.7545161008065,150 90))', -]; + 'value' => 'POLYGON((150 90,149.039264020162 80.2454838991936,146.193976625564 70.8658283817455,141.573480615127 62.2214883490199,135.355339059327 54.6446609406727,127.77851165098 48.4265193848728,119.134171618255 43.8060233744357,109.754516100806 40.9607359798385,100 40,90.2454838991937 40.9607359798385,80.8658283817456 43.8060233744356,72.22148834902 48.4265193848727,64.6446609406727 54.6446609406725,58.4265193848728 62.2214883490198,53.8060233744357 70.8658283817454,50.9607359798385 80.2454838991934,50 89.9999999999998,50.9607359798384 99.7545161008062,53.8060233744356 109.134171618254,58.4265193848726 117.77851165098,64.6446609406725 125.355339059327,72.2214883490197 131.573480615127,80.8658283817453 136.193976625564,90.2454838991934 139.039264020161,99.9999999999998 140,109.754516100806 139.039264020162,119.134171618254 136.193976625564,127.77851165098 131.573480615127,135.355339059327 125.355339059327,141.573480615127 117.77851165098,146.193976625564 109.134171618255,149.039264020162 99.7545161008065,150 90))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POLYGON((150 90,149.0392640201615 80.2454838991936,146.19397662556435 70.86582838174553,141.57348061512727 62.221488349019914,135.3553390593274 54.64466094067266,127.77851165098015 48.42651938487277,119.13417161825454 43.80602337443568,109.75451610080648 40.96073597983849,100.00000000000009 40,90.24548389919367 40.96073597983846,80.86582838174562 43.806023374435625,72.22148834901998 48.426519384872684,64.64466094067271 54.644660940672544,58.42651938487281 62.221488349019786,53.80602337443571 70.86582838174539,50.9607359798385 80.24548389919345,50 89.99999999999984,50.96073597983845 99.75451610080624,53.80602337443559 109.13417161825431,58.42651938487263 117.77851165097995,64.64466094067248 125.35533905932724,72.22148834901971 131.57348061512715,80.86582838174532 136.19397662556426,90.24548389919335 139.03926402016148,99.99999999999977 140,109.75451610080616 139.03926402016157,119.13417161825426 136.19397662556443,127.77851165097987 131.57348061512744,135.35533905932718 125.35533905932758,141.5734806151271 117.77851165098036,146.19397662556423 109.13417161825477,149.03926402016145 99.75451610080674,150 90))', -]; + 'value' => 'POLYGON((150 90,149.0392640201615 80.2454838991936,146.19397662556435 70.86582838174553,141.57348061512727 62.221488349019914,135.3553390593274 54.64466094067266,127.77851165098015 48.42651938487277,119.13417161825454 43.80602337443568,109.75451610080648 40.96073597983849,100.00000000000009 40,90.24548389919367 40.96073597983846,80.86582838174562 43.806023374435625,72.22148834901998 48.426519384872684,64.64466094067271 54.644660940672544,58.42651938487281 62.221488349019786,53.80602337443571 70.86582838174539,50.9607359798385 80.24548389919345,50 89.99999999999984,50.96073597983845 99.75451610080624,53.80602337443559 109.13417161825431,58.42651938487263 117.77851165097995,64.64466094067248 125.35533905932724,72.22148834901971 131.57348061512715,80.86582838174532 136.19397662556426,90.24548389919335 139.03926402016148,99.99999999999977 140,109.75451610080616 139.03926402016157,119.13417161825426 136.19397662556443,127.77851165097987 131.57348061512744,135.35533905932718 125.35533905932758,141.5734806151271 117.77851165098036,146.19397662556423 109.13417161825477,149.03926402016145 99.75451610080674,150 90))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -131,9 +131,9 @@ public function testQuery3(): void }); $expected = [ - 'promisingcircle_pcount' => 33, - 'lamecircle_pcount' => 9, -]; + 'promisingcircle_pcount' => 33, + 'lamecircle_pcount' => 9, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_CentroidTest.php b/tests/Functions/ST_CentroidTest.php index 2460d5ca..0de84124 100644 --- a/tests/Functions/ST_CentroidTest.php +++ b/tests/Functions/ST_CentroidTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(2.30769230769231 3.30769230769231)', -]; + 'value' => 'POINT(2.30769230769231 3.30769230769231)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POINT(2.307692307692308 3.307692307692308)', -]; + 'value' => 'POINT(2.307692307692308 3.307692307692308)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ClosestPointTest.php b/tests/Functions/ST_ClosestPointTest.php index e77bb6a0..749e3f76 100644 --- a/tests/Functions/ST_ClosestPointTest.php +++ b/tests/Functions/ST_ClosestPointTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(100 100)', -]; + 'value' => 'POINT(100 100)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_CollectTest.php b/tests/Functions/ST_CollectTest.php index 5d437931..a3ec1869 100644 --- a/tests/Functions/ST_CollectTest.php +++ b/tests/Functions/ST_CollectTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'MULTIPOINT(1 2,-2 3)', -]; + 'value' => 'MULTIPOINT(1 2,-2 3)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ContainsProperlyTest.php b/tests/Functions/ST_ContainsProperlyTest.php index edc1a99e..11f8eed8 100644 --- a/tests/Functions/ST_ContainsProperlyTest.php +++ b/tests/Functions/ST_ContainsProperlyTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ContainsTest.php b/tests/Functions/ST_ContainsTest.php index b3669c73..15dea1b7 100644 --- a/tests/Functions/ST_ContainsTest.php +++ b/tests/Functions/ST_ContainsTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_CoordDimTest.php b/tests/Functions/ST_CoordDimTest.php index aff951d8..bfb52c85 100644 --- a/tests/Functions/ST_CoordDimTest.php +++ b/tests/Functions/ST_CoordDimTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 2, -]; + 'value' => 2, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_CoveredByTest.php b/tests/Functions/ST_CoveredByTest.php index 7f9c756b..a8a0f20d 100644 --- a/tests/Functions/ST_CoveredByTest.php +++ b/tests/Functions/ST_CoveredByTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_CoversTest.php b/tests/Functions/ST_CoversTest.php index 667ba091..f64e0649 100644 --- a/tests/Functions/ST_CoversTest.php +++ b/tests/Functions/ST_CoversTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_CrossesTest.php b/tests/Functions/ST_CrossesTest.php index e39f94f2..76e53ea2 100644 --- a/tests/Functions/ST_CrossesTest.php +++ b/tests/Functions/ST_CrossesTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DFullyWithinTest.php b/tests/Functions/ST_DFullyWithinTest.php index 7b3fe009..a84679e1 100644 --- a/tests/Functions/ST_DFullyWithinTest.php +++ b/tests/Functions/ST_DFullyWithinTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DWithinTest.php b/tests/Functions/ST_DWithinTest.php index 667e6a7c..4b218f46 100644 --- a/tests/Functions/ST_DWithinTest.php +++ b/tests/Functions/ST_DWithinTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DifferenceTest.php b/tests/Functions/ST_DifferenceTest.php index bad3e470..1bd8874f 100644 --- a/tests/Functions/ST_DifferenceTest.php +++ b/tests/Functions/ST_DifferenceTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(50 150,50 200)', -]; + 'value' => 'LINESTRING(50 150,50 200)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DimensionTest.php b/tests/Functions/ST_DimensionTest.php index dc0c99db..f2918abe 100644 --- a/tests/Functions/ST_DimensionTest.php +++ b/tests/Functions/ST_DimensionTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1, -]; + 'value' => 1, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DisjointTest.php b/tests/Functions/ST_DisjointTest.php index bee6eaa0..62b5ff8d 100644 --- a/tests/Functions/ST_DisjointTest.php +++ b/tests/Functions/ST_DisjointTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DistanceSphereTest.php b/tests/Functions/ST_DistanceSphereTest.php index 31f4ae64..707d0669 100644 --- a/tests/Functions/ST_DistanceSphereTest.php +++ b/tests/Functions/ST_DistanceSphereTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 123.475736916, -]; + 'value' => 123.475736916, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DistanceSpheroidTest.php b/tests/Functions/ST_DistanceSpheroidTest.php index b1f06c67..7b24c25d 100644 --- a/tests/Functions/ST_DistanceSpheroidTest.php +++ b/tests/Functions/ST_DistanceSpheroidTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 123.802076746845, -]; + 'value' => 123.802076746845, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_DistanceTest.php b/tests/Functions/ST_DistanceTest.php index b93b0e1a..c7447e50 100644 --- a/tests/Functions/ST_DistanceTest.php +++ b/tests/Functions/ST_DistanceTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 0.00150567726382822, -]; + 'value' => 0.00150567726382822, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 123.475736916, -]; + 'value' => 123.475736916, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_EndPointTest.php b/tests/Functions/ST_EndPointTest.php index d0b08332..cbe78e2b 100644 --- a/tests/Functions/ST_EndPointTest.php +++ b/tests/Functions/ST_EndPointTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(3 3)', -]; + 'value' => 'POINT(3 3)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_EnvelopeTest.php b/tests/Functions/ST_EnvelopeTest.php index 27624ceb..f92d2e46 100644 --- a/tests/Functions/ST_EnvelopeTest.php +++ b/tests/Functions/ST_EnvelopeTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((0 0,0 3,1 3,1 0,0 0))', -]; + 'value' => 'POLYGON((0 0,0 3,1 3,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_EqualsTest.php b/tests/Functions/ST_EqualsTest.php index ea0d5614..92cda6b9 100644 --- a/tests/Functions/ST_EqualsTest.php +++ b/tests/Functions/ST_EqualsTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ExtentTest.php b/tests/Functions/ST_ExtentTest.php index b55d0ab2..894840ed 100644 --- a/tests/Functions/ST_ExtentTest.php +++ b/tests/Functions/ST_ExtentTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0103000020E61000000100000005000000957CEC2E50CA51C06EC328081E214540957CEC2E50CA51C07099D36531214540E44A3D0B42CA51C07099D36531214540E44A3D0B42CA51C06EC328081E214540957CEC2E50CA51C06EC328081E214540', -]; + 'value' => '0103000020E61000000100000005000000957CEC2E50CA51C06EC328081E214540957CEC2E50CA51C07099D36531214540E44A3D0B42CA51C07099D36531214540E44A3D0B42CA51C06EC328081E214540957CEC2E50CA51C06EC328081E214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ExteriorRingTest.php b/tests/Functions/ST_ExteriorRingTest.php index 775dd79a..7701659c 100644 --- a/tests/Functions/ST_ExteriorRingTest.php +++ b/tests/Functions/ST_ExteriorRingTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(0 0 1,1 1 1,1 2 1,1 1 1,0 0 1)', -]; + 'value' => 'LINESTRING(0 0 1,1 1 1,1 2 1,1 1 1,0 0 1)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_FlipCoordinatesTest.php b/tests/Functions/ST_FlipCoordinatesTest.php index f446d450..f7706b68 100644 --- a/tests/Functions/ST_FlipCoordinatesTest.php +++ b/tests/Functions/ST_FlipCoordinatesTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(2 1)', -]; + 'value' => 'POINT(2 1)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeoHashTest.php b/tests/Functions/ST_GeoHashTest.php index 450a0f17..00c2766f 100644 --- a/tests/Functions/ST_GeoHashTest.php +++ b/tests/Functions/ST_GeoHashTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'c0w3hf1s70w3hf1s70w3', -]; + 'value' => 'c0w3hf1s70w3hf1s70w3', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'c0w3h', -]; + 'value' => 'c0w3h', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeogFromTextTest.php b/tests/Functions/ST_GeogFromTextTest.php index 7ce5a7da..fe02d86f 100644 --- a/tests/Functions/ST_GeogFromTextTest.php +++ b/tests/Functions/ST_GeogFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeogFromWKBTest.php b/tests/Functions/ST_GeogFromWKBTest.php index a5bc1339..ac19f2bc 100644 --- a/tests/Functions/ST_GeogFromWKBTest.php +++ b/tests/Functions/ST_GeogFromWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(-113.98 39.198,-113.981 39.195)', -]; + 'value' => 'LINESTRING(-113.98 39.198,-113.981 39.195)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeographyFromTextTest.php b/tests/Functions/ST_GeographyFromTextTest.php index 272de84e..427f5d02 100644 --- a/tests/Functions/ST_GeographyFromTextTest.php +++ b/tests/Functions/ST_GeographyFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '0102000020E610000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomCollFromTextTest.php b/tests/Functions/ST_GeomCollFromTextTest.php index 4809b002..771b31b6 100644 --- a/tests/Functions/ST_GeomCollFromTextTest.php +++ b/tests/Functions/ST_GeomCollFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0107000000020000000101000000000000000000F03F0000000000000040010200000002000000000000000000F03F000000000000004000000000000008400000000000001040', -]; + 'value' => '0107000000020000000101000000000000000000F03F0000000000000040010200000002000000000000000000F03F000000000000004000000000000008400000000000001040', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '0107000020E6100000020000000101000000000000000000F03F0000000000000040010200000002000000000000000000F03F000000000000004000000000000008400000000000001040', -]; + 'value' => '0107000020E6100000020000000101000000000000000000F03F0000000000000040010200000002000000000000000000F03F000000000000004000000000000008400000000000001040', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromEWKBTest.php b/tests/Functions/ST_GeomFromEWKBTest.php index c1d566c2..83dbd896 100644 --- a/tests/Functions/ST_GeomFromEWKBTest.php +++ b/tests/Functions/ST_GeomFromEWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0103000020E61000000100000005000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000000000000000000000000000000000000000', -]; + 'value' => '0103000020E61000000100000005000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000000000000000000000000000000000000000', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromEWKTTest.php b/tests/Functions/ST_GeomFromEWKTTest.php index 26fe2146..f3272503 100644 --- a/tests/Functions/ST_GeomFromEWKTTest.php +++ b/tests/Functions/ST_GeomFromEWKTTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromGMLTest.php b/tests/Functions/ST_GeomFromGMLTest.php index ad3bbcaf..1c3f51d8 100644 --- a/tests/Functions/ST_GeomFromGMLTest.php +++ b/tests/Functions/ST_GeomFromGMLTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', -]; + 'value' => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -125,8 +125,8 @@ public function testQuery3(): void }); $expected = [ - 'value' => 'SRID=4326;LINESTRING(-71.16028 42.258729,-71.160837 42.259112,-71.161143 42.25932)', -]; + 'value' => 'SRID=4326;LINESTRING(-71.16028 42.258729,-71.160837 42.259112,-71.161143 42.25932)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromGeoHashTest.php b/tests/Functions/ST_GeomFromGeoHashTest.php index 8cf0f2d8..e01da9a1 100644 --- a/tests/Functions/ST_GeomFromGeoHashTest.php +++ b/tests/Functions/ST_GeomFromGeoHashTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646))', -]; + 'value' => 'POLYGON((-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POLYGON((-115.17281600000001 36.11464599999999,-115.17281600000001 36.114646,-115.172816 36.114646,-115.172816 36.11464599999999,-115.17281600000001 36.11464599999999))', -]; + 'value' => 'POLYGON((-115.17281600000001 36.11464599999999,-115.17281600000001 36.114646,-115.172816 36.114646,-115.172816 36.11464599999999,-115.17281600000001 36.11464599999999))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -131,8 +131,8 @@ public function testQuery3(): void }); $expected = [ - 'value' => 'POLYGON((-115.3125 36.03515625,-115.3125 36.2109375,-114.9609375 36.2109375,-114.9609375 36.03515625,-115.3125 36.03515625))', -]; + 'value' => 'POLYGON((-115.3125 36.03515625,-115.3125 36.2109375,-114.9609375 36.2109375,-114.9609375 36.03515625,-115.3125 36.03515625))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromGeoJSONTest.php b/tests/Functions/ST_GeomFromGeoJSONTest.php index b0a2b7ea..05e7b737 100644 --- a/tests/Functions/ST_GeomFromGeoJSONTest.php +++ b/tests/Functions/ST_GeomFromGeoJSONTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(-48.23456 20.12345)', -]; + 'value' => 'POINT(-48.23456 20.12345)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'LINESTRING Z (1 2 3,4 5 6,7 8 9)', -]; + 'value' => 'LINESTRING Z (1 2 3,4 5 6,7 8 9)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromKMLTest.php b/tests/Functions/ST_GeomFromKMLTest.php index c4dc3f9d..124578f2 100644 --- a/tests/Functions/ST_GeomFromKMLTest.php +++ b/tests/Functions/ST_GeomFromKMLTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(-71.1663 42.2614,-71.1667 42.2616)', -]; + 'value' => 'LINESTRING(-71.1663 42.2614,-71.1667 42.2616)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromTextTest.php b/tests/Functions/ST_GeomFromTextTest.php index cde6039a..492ffba0 100644 --- a/tests/Functions/ST_GeomFromTextTest.php +++ b/tests/Functions/ST_GeomFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '010200000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '010200000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeomFromWKBTest.php b/tests/Functions/ST_GeomFromWKBTest.php index ec632954..46e6b75e 100644 --- a/tests/Functions/ST_GeomFromWKBTest.php +++ b/tests/Functions/ST_GeomFromWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0103000020E61000000100000005000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000000000000000000000000000000000000000', -]; + 'value' => '0103000020E61000000100000005000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000000000000000000000000000000000000000', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeometryFromTextTest.php b/tests/Functions/ST_GeometryFromTextTest.php index e8f6e750..f39c4d14 100644 --- a/tests/Functions/ST_GeometryFromTextTest.php +++ b/tests/Functions/ST_GeometryFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '010200000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '010200000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', -]; + 'value' => '0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeometryNTest.php b/tests/Functions/ST_GeometryNTest.php index 87eb2044..503f6ebb 100644 --- a/tests/Functions/ST_GeometryNTest.php +++ b/tests/Functions/ST_GeometryNTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(0 0 1,1 1 1,1 2 1,1 1 1,0 0 1)', -]; + 'value' => 'LINESTRING(0 0 1,1 1 1,1 2 1,1 1 1,0 0 1)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_GeometryTypeTest.php b/tests/Functions/ST_GeometryTypeTest.php index 0a6de751..8ac05ee4 100644 --- a/tests/Functions/ST_GeometryTypeTest.php +++ b/tests/Functions/ST_GeometryTypeTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'ST_LineString', -]; + 'value' => 'ST_LineString', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_HasArcTest.php b/tests/Functions/ST_HasArcTest.php index d88da99e..3b41a1a6 100644 --- a/tests/Functions/ST_HasArcTest.php +++ b/tests/Functions/ST_HasArcTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_HausdorffDistanceTest.php b/tests/Functions/ST_HausdorffDistanceTest.php index e0ef4f28..0544f165 100644 --- a/tests/Functions/ST_HausdorffDistanceTest.php +++ b/tests/Functions/ST_HausdorffDistanceTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 70, -]; + 'value' => 70, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_InteriorRingNTest.php b/tests/Functions/ST_InteriorRingNTest.php index 61aec6d2..4df74b72 100644 --- a/tests/Functions/ST_InteriorRingNTest.php +++ b/tests/Functions/ST_InteriorRingNTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)', -]; + 'value' => 'LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IntersectionTest.php b/tests/Functions/ST_IntersectionTest.php index 4d9e4f7a..4781d8b5 100644 --- a/tests/Functions/ST_IntersectionTest.php +++ b/tests/Functions/ST_IntersectionTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(0 0)', -]; + 'value' => 'POINT(0 0)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IntersectsTest.php b/tests/Functions/ST_IntersectsTest.php index bc7f624f..e1830e8d 100644 --- a/tests/Functions/ST_IntersectsTest.php +++ b/tests/Functions/ST_IntersectsTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsClosedTest.php b/tests/Functions/ST_IsClosedTest.php index a88d1aa4..be1d674d 100644 --- a/tests/Functions/ST_IsClosedTest.php +++ b/tests/Functions/ST_IsClosedTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsCollectionTest.php b/tests/Functions/ST_IsCollectionTest.php index 11bb1b16..95accd62 100644 --- a/tests/Functions/ST_IsCollectionTest.php +++ b/tests/Functions/ST_IsCollectionTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsEmptyTest.php b/tests/Functions/ST_IsEmptyTest.php index 25554d5c..7add41a8 100644 --- a/tests/Functions/ST_IsEmptyTest.php +++ b/tests/Functions/ST_IsEmptyTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsRingTest.php b/tests/Functions/ST_IsRingTest.php index 3d2c1269..21eba126 100644 --- a/tests/Functions/ST_IsRingTest.php +++ b/tests/Functions/ST_IsRingTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsSimpleTest.php b/tests/Functions/ST_IsSimpleTest.php index 54aab8a1..633bc6f4 100644 --- a/tests/Functions/ST_IsSimpleTest.php +++ b/tests/Functions/ST_IsSimpleTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsValidDetailTest.php b/tests/Functions/ST_IsValidDetailTest.php index 70cae930..3d6e0cfd 100644 --- a/tests/Functions/ST_IsValidDetailTest.php +++ b/tests/Functions/ST_IsValidDetailTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '(f,"Too few points in geometry component",0101000000000000000000F03F000000000000F03F)', -]; + 'value' => '(f,"Too few points in geometry component",0101000000000000000000F03F000000000000F03F)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => '(t,,)', -]; + 'value' => '(t,,)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsValidReasonTest.php b/tests/Functions/ST_IsValidReasonTest.php index 7e613b4f..2dc8e05f 100644 --- a/tests/Functions/ST_IsValidReasonTest.php +++ b/tests/Functions/ST_IsValidReasonTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'Valid Geometry', -]; + 'value' => 'Valid Geometry', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'Valid Geometry', -]; + 'value' => 'Valid Geometry', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_IsValidTest.php b/tests/Functions/ST_IsValidTest.php index bf915a5b..39a5d7f4 100644 --- a/tests/Functions/ST_IsValidTest.php +++ b/tests/Functions/ST_IsValidTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => false, -]; + 'value' => false, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -125,8 +125,8 @@ public function testQuery3(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LengthSpheroidTest.php b/tests/Functions/ST_LengthSpheroidTest.php index ca2c2eed..fb03129d 100644 --- a/tests/Functions/ST_LengthSpheroidTest.php +++ b/tests/Functions/ST_LengthSpheroidTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 85204.5207711805, -]; + 'value' => 85204.5207711805, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LengthTest.php b/tests/Functions/ST_LengthTest.php index 5fcbf408..32fc41aa 100644 --- a/tests/Functions/ST_LengthTest.php +++ b/tests/Functions/ST_LengthTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 122.630744000095, -]; + 'value' => 122.630744000095, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 34346.2060960742, -]; + 'value' => 34346.2060960742, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LineCrossingDirectionTest.php b/tests/Functions/ST_LineCrossingDirectionTest.php index 24d9dcb9..b3251147 100644 --- a/tests/Functions/ST_LineCrossingDirectionTest.php +++ b/tests/Functions/ST_LineCrossingDirectionTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => -3, -]; + 'value' => -3, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LineFromMultiPointTest.php b/tests/Functions/ST_LineFromMultiPointTest.php index b7e2b4c7..cbc84d43 100644 --- a/tests/Functions/ST_LineFromMultiPointTest.php +++ b/tests/Functions/ST_LineFromMultiPointTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(1 2 3,4 5 6,7 8 9)', -]; + 'value' => 'LINESTRING(1 2 3,4 5 6,7 8 9)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LineFromTextTest.php b/tests/Functions/ST_LineFromTextTest.php index 1170fa22..a9a6f785 100644 --- a/tests/Functions/ST_LineFromTextTest.php +++ b/tests/Functions/ST_LineFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020E610000002000000000000000000F03F000000000000004000000000000008400000000000001040', -]; + 'value' => '0102000020E610000002000000000000000000F03F000000000000004000000000000008400000000000001040', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LineFromWKBTest.php b/tests/Functions/ST_LineFromWKBTest.php index d7a4f225..42e2f213 100644 --- a/tests/Functions/ST_LineFromWKBTest.php +++ b/tests/Functions/ST_LineFromWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020E610000002000000000000000000F03F000000000000004000000000000008400000000000001040', -]; + 'value' => '0102000020E610000002000000000000000000F03F000000000000004000000000000008400000000000001040', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LinestringFromWKBTest.php b/tests/Functions/ST_LinestringFromWKBTest.php index 2ca258ad..3dd6494f 100644 --- a/tests/Functions/ST_LinestringFromWKBTest.php +++ b/tests/Functions/ST_LinestringFromWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0102000020E610000002000000000000000000F03F000000000000004000000000000008400000000000001040', -]; + 'value' => '0102000020E610000002000000000000000000F03F000000000000004000000000000008400000000000001040', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_LongestLineTest.php b/tests/Functions/ST_LongestLineTest.php index a8970fe4..17347f99 100644 --- a/tests/Functions/ST_LongestLineTest.php +++ b/tests/Functions/ST_LongestLineTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(100 100,98 190)', -]; + 'value' => 'LINESTRING(100 100,98 190)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MLineFromTextTest.php b/tests/Functions/ST_MLineFromTextTest.php index 501cd9c4..8e617ed2 100644 --- a/tests/Functions/ST_MLineFromTextTest.php +++ b/tests/Functions/ST_MLineFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0105000020E610000002000000010200000002000000000000000000F03F0000000000000040000000000000084000000000000010400102000000020000000000000000001040000000000000144000000000000018400000000000001C40', -]; + 'value' => '0105000020E610000002000000010200000002000000000000000000F03F0000000000000040000000000000084000000000000010400102000000020000000000000000001040000000000000144000000000000018400000000000001C40', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MPointFromTextTest.php b/tests/Functions/ST_MPointFromTextTest.php index 5f5a27b6..d1439270 100644 --- a/tests/Functions/ST_MPointFromTextTest.php +++ b/tests/Functions/ST_MPointFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0104000020E61000000200000001010000004C37894160BD51C0C976BE9F1A0F45400101000000E10B93A982BD51C08126C286A70F4540', -]; + 'value' => '0104000020E61000000200000001010000004C37894160BD51C0C976BE9F1A0F45400101000000E10B93A982BD51C08126C286A70F4540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MPolyFromTextTest.php b/tests/Functions/ST_MPolyFromTextTest.php index 0a1ce1d2..e4be2b8d 100644 --- a/tests/Functions/ST_MPolyFromTextTest.php +++ b/tests/Functions/ST_MPolyFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '01060000A0E6100000010000000103000080020000000500000000000000000000000000000000000000000000000000F03F00000000000034400000000000000000000000000000F03F00000000000034400000000000003440000000000000F03F00000000000000000000000000003440000000000000F03F00000000000000000000000000000000000000000000F03F0500000000000000000014400000000000001440000000000000084000000000000014400000000000001C4000000000000008400000000000001C400000000000001C4000000000000008400000000000001C4000000000000014400000000000000840000000000000144000000000000014400000000000000840', -]; + 'value' => '01060000A0E6100000010000000103000080020000000500000000000000000000000000000000000000000000000000F03F00000000000034400000000000000000000000000000F03F00000000000034400000000000003440000000000000F03F00000000000000000000000000003440000000000000F03F00000000000000000000000000000000000000000000F03F0500000000000000000014400000000000001440000000000000084000000000000014400000000000001C4000000000000008400000000000001C400000000000001C4000000000000008400000000000001C4000000000000014400000000000000840000000000000144000000000000014400000000000000840', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -98,8 +98,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => null, -]; + 'value' => null, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MTest.php b/tests/Functions/ST_MTest.php index 316e2ab8..6dda060c 100644 --- a/tests/Functions/ST_MTest.php +++ b/tests/Functions/ST_MTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 4, -]; + 'value' => 4, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MakeBox2DTest.php b/tests/Functions/ST_MakeBox2DTest.php index 19843a14..173da7ae 100644 --- a/tests/Functions/ST_MakeBox2DTest.php +++ b/tests/Functions/ST_MakeBox2DTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'BOX(-989502.1875 528439.5625,-987121.375 529933.1875)', -]; + 'value' => 'BOX(-989502.1875 528439.5625,-987121.375 529933.1875)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MakeEnvelopeTest.php b/tests/Functions/ST_MakeEnvelopeTest.php index dd0b8678..81050b96 100644 --- a/tests/Functions/ST_MakeEnvelopeTest.php +++ b/tests/Functions/ST_MakeEnvelopeTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'SRID=4326;POLYGON((10 10,10 11,11 11,11 10,10 10))', -]; + 'value' => 'SRID=4326;POLYGON((10 10,10 11,11 11,11 10,10 10))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MakeLineTest.php b/tests/Functions/ST_MakeLineTest.php index e7a930d7..66c79ccd 100644 --- a/tests/Functions/ST_MakeLineTest.php +++ b/tests/Functions/ST_MakeLineTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(1 2,3 4)', -]; + 'value' => 'LINESTRING(1 2,3 4)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MakePointMTest.php b/tests/Functions/ST_MakePointMTest.php index 460bb6bf..7bf56639 100644 --- a/tests/Functions/ST_MakePointMTest.php +++ b/tests/Functions/ST_MakePointMTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINTM(-71.1043443253471 42.3150676015829 10)', -]; + 'value' => 'POINTM(-71.1043443253471 42.3150676015829 10)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MakePointTest.php b/tests/Functions/ST_MakePointTest.php index 8c9c5eed..bc2c4188 100644 --- a/tests/Functions/ST_MakePointTest.php +++ b/tests/Functions/ST_MakePointTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '01010000C0000000000000F03F0000000000000040000000000000F83F0000000000000040', -]; + 'value' => '01010000C0000000000000F03F0000000000000040000000000000F83F0000000000000040', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MakePolygonTest.php b/tests/Functions/ST_MakePolygonTest.php index 4730a114..bf14f2f1 100644 --- a/tests/Functions/ST_MakePolygonTest.php +++ b/tests/Functions/ST_MakePolygonTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((75.15 29.53,77 29,77.6 29.5,75.15 29.53))', -]; + 'value' => 'POLYGON((75.15 29.53,77 29,77.6 29.5,75.15 29.53))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MaxDistanceTest.php b/tests/Functions/ST_MaxDistanceTest.php index c0719f3f..cd526ead 100644 --- a/tests/Functions/ST_MaxDistanceTest.php +++ b/tests/Functions/ST_MaxDistanceTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 2, -]; + 'value' => 2, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MinimumBoundingCircleTest.php b/tests/Functions/ST_MinimumBoundingCircleTest.php index 27fc25bb..b84b2be9 100644 --- a/tests/Functions/ST_MinimumBoundingCircleTest.php +++ b/tests/Functions/ST_MinimumBoundingCircleTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((15 22.6536686473018,20.411961001462 20.411961001462,22.6536686473018 15,20.411961001462 9.58803899853803,15 7.3463313526982,9.58803899853803 9.58803899853803,7.3463313526982 15,9.58803899853803 20.411961001462,15 22.6536686473018))', -]; + 'value' => 'POLYGON((15 22.6536686473018,20.411961001462 20.411961001462,22.6536686473018 15,20.411961001462 9.58803899853803,15 7.3463313526982,9.58803899853803 9.58803899853803,7.3463313526982 15,9.58803899853803 20.411961001462,15 22.6536686473018))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POLYGON((15 22.653668647301796,20.411961001461968 20.41196100146197,22.653668647301796 15,20.41196100146197 9.58803899853803,15.000000000000002 7.346331352698204,9.58803899853803 9.588038998538028,7.346331352698204 14.999999999999998,9.588038998538028 20.411961001461968,14.999999999999998 22.653668647301796))', -]; + 'value' => 'POLYGON((15 22.653668647301796,20.411961001461968 20.41196100146197,22.653668647301796 15,20.41196100146197 9.58803899853803,15.000000000000002 7.346331352698204,9.58803899853803 9.588038998538028,7.346331352698204 14.999999999999998,9.588038998538028 20.411961001461968,14.999999999999998 22.653668647301796))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_MultiTest.php b/tests/Functions/ST_MultiTest.php index 3dfb8567..109f0b69 100644 --- a/tests/Functions/ST_MultiTest.php +++ b/tests/Functions/ST_MultiTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'MULTIPOLYGON(((743238 2967416,743238 2967450,743265 2967450,743265.625 2967416,743238 2967416)))', -]; + 'value' => 'MULTIPOLYGON(((743238 2967416,743238 2967450,743265 2967450,743265.625 2967416,743238 2967416)))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NDimsTest.php b/tests/Functions/ST_NDimsTest.php index 010e4396..da1d86f9 100644 --- a/tests/Functions/ST_NDimsTest.php +++ b/tests/Functions/ST_NDimsTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 2, -]; + 'value' => 2, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 3, -]; + 'value' => 3, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NPointsTest.php b/tests/Functions/ST_NPointsTest.php index 33dba3fa..37522a7e 100644 --- a/tests/Functions/ST_NPointsTest.php +++ b/tests/Functions/ST_NPointsTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 4, -]; + 'value' => 4, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 4, -]; + 'value' => 4, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NRingsTest.php b/tests/Functions/ST_NRingsTest.php index 511d5f1c..2001ae77 100644 --- a/tests/Functions/ST_NRingsTest.php +++ b/tests/Functions/ST_NRingsTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1, -]; + 'value' => 1, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NumGeometriesTest.php b/tests/Functions/ST_NumGeometriesTest.php index b64ff600..a73e22c6 100644 --- a/tests/Functions/ST_NumGeometriesTest.php +++ b/tests/Functions/ST_NumGeometriesTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1, -]; + 'value' => 1, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 3, -]; + 'value' => 3, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NumInteriorRingTest.php b/tests/Functions/ST_NumInteriorRingTest.php index 86acdd72..789fb394 100644 --- a/tests/Functions/ST_NumInteriorRingTest.php +++ b/tests/Functions/ST_NumInteriorRingTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1, -]; + 'value' => 1, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NumInteriorRingsTest.php b/tests/Functions/ST_NumInteriorRingsTest.php index 69f16e8e..5dfd56c9 100644 --- a/tests/Functions/ST_NumInteriorRingsTest.php +++ b/tests/Functions/ST_NumInteriorRingsTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1, -]; + 'value' => 1, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NumPatchesTest.php b/tests/Functions/ST_NumPatchesTest.php index 61ca6cac..fdd630e4 100644 --- a/tests/Functions/ST_NumPatchesTest.php +++ b/tests/Functions/ST_NumPatchesTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 6, -]; + 'value' => 6, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_NumPointsTest.php b/tests/Functions/ST_NumPointsTest.php index a7bb39aa..03464200 100644 --- a/tests/Functions/ST_NumPointsTest.php +++ b/tests/Functions/ST_NumPointsTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 4, -]; + 'value' => 4, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_OrderingEqualsTest.php b/tests/Functions/ST_OrderingEqualsTest.php index 79ee2657..30fad2df 100644 --- a/tests/Functions/ST_OrderingEqualsTest.php +++ b/tests/Functions/ST_OrderingEqualsTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_OverlapsTest.php b/tests/Functions/ST_OverlapsTest.php index 7e304f4c..aebfff38 100644 --- a/tests/Functions/ST_OverlapsTest.php +++ b/tests/Functions/ST_OverlapsTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PatchNTest.php b/tests/Functions/ST_PatchNTest.php index a6843f7f..78226843 100644 --- a/tests/Functions/ST_PatchNTest.php +++ b/tests/Functions/ST_PatchNTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))', -]; + 'value' => 'POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PerimeterTest.php b/tests/Functions/ST_PerimeterTest.php index e4a8b1ea..93507836 100644 --- a/tests/Functions/ST_PerimeterTest.php +++ b/tests/Functions/ST_PerimeterTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 122.630744000095, -]; + 'value' => 122.630744000095, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 257.412311446337, -]; + 'value' => 257.412311446337, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PointFromGeoHashTest.php b/tests/Functions/ST_PointFromGeoHashTest.php index 2ef00337..5fb18fd5 100644 --- a/tests/Functions/ST_PointFromGeoHashTest.php +++ b/tests/Functions/ST_PointFromGeoHashTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(-115.172816 36.114646)', -]; + 'value' => 'POINT(-115.172816 36.114646)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POINT(-115.17281600000001 36.11464599999999)', -]; + 'value' => 'POINT(-115.17281600000001 36.11464599999999)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -131,8 +131,8 @@ public function testQuery3(): void }); $expected = [ - 'value' => 'POINT(-115.13671875 36.123046875)', -]; + 'value' => 'POINT(-115.13671875 36.123046875)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PointFromTextTest.php b/tests/Functions/ST_PointFromTextTest.php index 6c257f5f..93da4944 100644 --- a/tests/Functions/ST_PointFromTextTest.php +++ b/tests/Functions/ST_PointFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0101000020E6100000CB49287D21C451C0F0BF95ECD8244540', -]; + 'value' => '0101000020E6100000CB49287D21C451C0F0BF95ECD8244540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PointFromWKBTest.php b/tests/Functions/ST_PointFromWKBTest.php index 032d07d7..f7ac0654 100644 --- a/tests/Functions/ST_PointFromWKBTest.php +++ b/tests/Functions/ST_PointFromWKBTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0101000020E6100000CB49287D21C451C0F0BF95ECD8244540', -]; + 'value' => '0101000020E6100000CB49287D21C451C0F0BF95ECD8244540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PointNTest.php b/tests/Functions/ST_PointNTest.php index d94e4781..8944931f 100644 --- a/tests/Functions/ST_PointNTest.php +++ b/tests/Functions/ST_PointNTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(1 1)', -]; + 'value' => 'POINT(1 1)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PointOnSurfaceTest.php b/tests/Functions/ST_PointOnSurfaceTest.php index 803af80e..23768aa8 100644 --- a/tests/Functions/ST_PointOnSurfaceTest.php +++ b/tests/Functions/ST_PointOnSurfaceTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(0 5)', -]; + 'value' => 'POINT(0 5)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PointTest.php b/tests/Functions/ST_PointTest.php index 19468858..74963a2f 100644 --- a/tests/Functions/ST_PointTest.php +++ b/tests/Functions/ST_PointTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0101000000000000000000F03F0000000000000040', -]; + 'value' => '0101000000000000000000F03F0000000000000040', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PolygonFromTextTest.php b/tests/Functions/ST_PolygonFromTextTest.php index 9f351c0e..811058cc 100644 --- a/tests/Functions/ST_PolygonFromTextTest.php +++ b/tests/Functions/ST_PolygonFromTextTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0103000020E610000001000000050000006285C7C15ECB51C0ED88FC0DF531454028A46F245FCB51C009075EA6F731454047DED1E65DCB51C0781C510EF83145404871A7835DCB51C0EBDAEE75F53145406285C7C15ECB51C0ED88FC0DF5314540', -]; + 'value' => '0103000020E610000001000000050000006285C7C15ECB51C0ED88FC0DF531454028A46F245FCB51C009075EA6F731454047DED1E65DCB51C0781C510EF83145404871A7835DCB51C0EBDAEE75F53145406285C7C15ECB51C0ED88FC0DF5314540', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_PolygonTest.php b/tests/Functions/ST_PolygonTest.php index 659718a9..3e773e3b 100644 --- a/tests/Functions/ST_PolygonTest.php +++ b/tests/Functions/ST_PolygonTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => '0103000020E610000001000000040000009A99999999C9524048E17A14AE873D4000000000004053400000000000003D4066666666666653400000000000803D409A99999999C9524048E17A14AE873D40', -]; + 'value' => '0103000020E610000001000000040000009A99999999C9524048E17A14AE873D4000000000004053400000000000003D4066666666666653400000000000803D409A99999999C9524048E17A14AE873D40', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ProjectTest.php b/tests/Functions/ST_ProjectTest.php index ef800e4f..1a08e797 100644 --- a/tests/Functions/ST_ProjectTest.php +++ b/tests/Functions/ST_ProjectTest.php @@ -71,9 +71,9 @@ public function testQuery1(): void }); $expected = [ - 'value1' => 0.635231029125537, - 'value2' => 0.639472334729198, -]; + 'value1' => 0.635231029125537, + 'value2' => 0.639472334729198, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_RelateTest.php b/tests/Functions/ST_RelateTest.php index 8c19d0e1..c81feb0b 100644 --- a/tests/Functions/ST_RelateTest.php +++ b/tests/Functions/ST_RelateTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_SRIDTest.php b/tests/Functions/ST_SRIDTest.php index e53dea75..d3c756ed 100644 --- a/tests/Functions/ST_SRIDTest.php +++ b/tests/Functions/ST_SRIDTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 4326, -]; + 'value' => 4326, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ScaleTest.php b/tests/Functions/ST_ScaleTest.php index 62e2676e..f7ad6b54 100644 --- a/tests/Functions/ST_ScaleTest.php +++ b/tests/Functions/ST_ScaleTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(0.5 1.5 2.4,0.5 0.75 0.8)', -]; + 'value' => 'LINESTRING(0.5 1.5 2.4,0.5 0.75 0.8)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_SetSRIDTest.php b/tests/Functions/ST_SetSRIDTest.php index a88ea3e5..f4f41576 100644 --- a/tests/Functions/ST_SetSRIDTest.php +++ b/tests/Functions/ST_SetSRIDTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'SRID=4326;POINT(-123.365556 48.428611)', -]; + 'value' => 'SRID=4326;POINT(-123.365556 48.428611)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ShiftLongitudeTest.php b/tests/Functions/ST_ShiftLongitudeTest.php index faea8a0d..42cd5375 100644 --- a/tests/Functions/ST_ShiftLongitudeTest.php +++ b/tests/Functions/ST_ShiftLongitudeTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(241.42 38.38,241.8 38.45)', -]; + 'value' => 'LINESTRING(241.42 38.38,241.8 38.45)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'LINESTRING(241.42000000000002 38.38,241.8 38.45)', -]; + 'value' => 'LINESTRING(241.42000000000002 38.38,241.8 38.45)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ShortestLineTest.php b/tests/Functions/ST_ShortestLineTest.php index 68532985..3cce458d 100644 --- a/tests/Functions/ST_ShortestLineTest.php +++ b/tests/Functions/ST_ShortestLineTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(100 100,73.0769230769231 115.384615384615)', -]; + 'value' => 'LINESTRING(100 100,73.0769230769231 115.384615384615)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'LINESTRING(100 100,73.07692307692307 115.38461538461539)', -]; + 'value' => 'LINESTRING(100 100,73.07692307692307 115.38461538461539)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_SnapToGridTest.php b/tests/Functions/ST_SnapToGridTest.php index e8c9a3fb..d01849d5 100644 --- a/tests/Functions/ST_SnapToGridTest.php +++ b/tests/Functions/ST_SnapToGridTest.php @@ -71,10 +71,10 @@ public function testQuery1(): void }); $expected = [ - 'value1' => 'LINESTRING(1.112 2.123,4.111 3.237)', - 'value2' => 'LINESTRING(-1.08 2.12 2.3 1.1144,4.12 3.22 3.1 1.1144,-1.08 2.12 2.3 1.1144)', - 'value3' => 'LINESTRING(-1.11 2.12 3 2.3456,4.11 3.24 3.1234 1.1111)', -]; + 'value1' => 'LINESTRING(1.112 2.123,4.111 3.237)', + 'value2' => 'LINESTRING(-1.08 2.12 2.3 1.1144,4.12 3.22 3.1 1.1144,-1.08 2.12 2.3 1.1144)', + 'value3' => 'LINESTRING(-1.11 2.12 3 2.3456,4.11 3.24 3.1234 1.1111)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_SplitTest.php b/tests/Functions/ST_SplitTest.php index 90e07c1e..f66e8730 100644 --- a/tests/Functions/ST_SplitTest.php +++ b/tests/Functions/ST_SplitTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'GEOMETRYCOLLECTION(POLYGON((150 90,149.039264020162 80.2454838991936,146.193976625564 70.8658283817455,141.573480615127 62.2214883490199,135.355339059327 54.6446609406727,127.77851165098 48.4265193848728,119.134171618255 43.8060233744357,109.754516100806 40.9607359798385,100 40,90.2454838991937 40.9607359798385,80.8658283817456 43.8060233744356,72.22148834902 48.4265193848727,64.6446609406727 54.6446609406725,60.1371179574584 60.1371179574584,129.862882042542 129.862882042542,135.355339059327 125.355339059327,141.573480615127 117.77851165098,146.193976625564 109.134171618255,149.039264020162 99.7545161008065,150 90)),POLYGON((60.1371179574584 60.1371179574584,58.4265193848728 62.2214883490198,53.8060233744357 70.8658283817454,50.9607359798385 80.2454838991934,50 89.9999999999998,50.9607359798384 99.7545161008062,53.8060233744356 109.134171618254,58.4265193848726 117.77851165098,64.6446609406725 125.355339059327,72.2214883490197 131.573480615127,80.8658283817453 136.193976625564,90.2454838991934 139.039264020161,99.9999999999998 140,109.754516100806 139.039264020162,119.134171618254 136.193976625564,127.77851165098 131.573480615127,129.862882042542 129.862882042542,60.1371179574584 60.1371179574584)))', -]; + 'value' => 'GEOMETRYCOLLECTION(POLYGON((150 90,149.039264020162 80.2454838991936,146.193976625564 70.8658283817455,141.573480615127 62.2214883490199,135.355339059327 54.6446609406727,127.77851165098 48.4265193848728,119.134171618255 43.8060233744357,109.754516100806 40.9607359798385,100 40,90.2454838991937 40.9607359798385,80.8658283817456 43.8060233744356,72.22148834902 48.4265193848727,64.6446609406727 54.6446609406725,60.1371179574584 60.1371179574584,129.862882042542 129.862882042542,135.355339059327 125.355339059327,141.573480615127 117.77851165098,146.193976625564 109.134171618255,149.039264020162 99.7545161008065,150 90)),POLYGON((60.1371179574584 60.1371179574584,58.4265193848728 62.2214883490198,53.8060233744357 70.8658283817454,50.9607359798385 80.2454838991934,50 89.9999999999998,50.9607359798384 99.7545161008062,53.8060233744356 109.134171618254,58.4265193848726 117.77851165098,64.6446609406725 125.355339059327,72.2214883490197 131.573480615127,80.8658283817453 136.193976625564,90.2454838991934 139.039264020161,99.9999999999998 140,109.754516100806 139.039264020162,119.134171618254 136.193976625564,127.77851165098 131.573480615127,129.862882042542 129.862882042542,60.1371179574584 60.1371179574584)))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'GEOMETRYCOLLECTION(POLYGON((150 90,149.0392640201615 80.2454838991936,146.19397662556435 70.86582838174553,141.57348061512727 62.221488349019914,135.3553390593274 54.64466094067266,127.77851165098015 48.42651938487277,119.13417161825454 43.80602337443568,109.75451610080648 40.96073597983849,100.00000000000009 40,90.24548389919367 40.96073597983846,80.86582838174562 43.806023374435625,72.22148834901998 48.426519384872684,64.64466094067271 54.644660940672544,60.13711795745844 60.13711795745844,129.86288204254154 129.86288204254154,135.35533905932718 125.35533905932758,141.5734806151271 117.77851165098036,146.19397662556423 109.13417161825477,149.03926402016145 99.75451610080674,150 90)),POLYGON((60.13711795745844 60.13711795745844,58.42651938487281 62.221488349019786,53.80602337443571 70.86582838174539,50.9607359798385 80.24548389919345,50 89.99999999999984,50.96073597983845 99.75451610080624,53.80602337443559 109.13417161825431,58.42651938487263 117.77851165097995,64.64466094067248 125.35533905932724,72.22148834901971 131.57348061512715,80.86582838174532 136.19397662556426,90.24548389919335 139.03926402016148,99.99999999999977 140,109.75451610080616 139.03926402016157,119.13417161825426 136.19397662556443,127.77851165097987 131.57348061512744,129.86288204254154 129.86288204254154,60.13711795745844 60.13711795745844)))', -]; + 'value' => 'GEOMETRYCOLLECTION(POLYGON((150 90,149.0392640201615 80.2454838991936,146.19397662556435 70.86582838174553,141.57348061512727 62.221488349019914,135.3553390593274 54.64466094067266,127.77851165098015 48.42651938487277,119.13417161825454 43.80602337443568,109.75451610080648 40.96073597983849,100.00000000000009 40,90.24548389919367 40.96073597983846,80.86582838174562 43.806023374435625,72.22148834901998 48.426519384872684,64.64466094067271 54.644660940672544,60.13711795745844 60.13711795745844,129.86288204254154 129.86288204254154,135.35533905932718 125.35533905932758,141.5734806151271 117.77851165098036,146.19397662556423 109.13417161825477,149.03926402016145 99.75451610080674,150 90)),POLYGON((60.13711795745844 60.13711795745844,58.42651938487281 62.221488349019786,53.80602337443571 70.86582838174539,50.9607359798385 80.24548389919345,50 89.99999999999984,50.96073597983845 99.75451610080624,53.80602337443559 109.13417161825431,58.42651938487263 117.77851165097995,64.64466094067248 125.35533905932724,72.22148834901971 131.57348061512715,80.86582838174532 136.19397662556426,90.24548389919335 139.03926402016148,99.99999999999977 140,109.75451610080616 139.03926402016157,119.13417161825426 136.19397662556443,127.77851165097987 131.57348061512744,129.86288204254154 129.86288204254154,60.13711795745844 60.13711795745844)))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_StartPointTest.php b/tests/Functions/ST_StartPointTest.php index a110a0cf..65aab334 100644 --- a/tests/Functions/ST_StartPointTest.php +++ b/tests/Functions/ST_StartPointTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(0 1)', -]; + 'value' => 'POINT(0 1)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_SummaryTest.php b/tests/Functions/ST_SummaryTest.php index 72e6bede..d2e1fe15 100644 --- a/tests/Functions/ST_SummaryTest.php +++ b/tests/Functions/ST_SummaryTest.php @@ -71,9 +71,9 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'Polygon[B] with 1 ring: + 'value' => 'Polygon[B] with 1 ring: ring 0 has 5 points', -]; + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_SymDifferenceTest.php b/tests/Functions/ST_SymDifferenceTest.php index 92fd0904..55474cd9 100644 --- a/tests/Functions/ST_SymDifferenceTest.php +++ b/tests/Functions/ST_SymDifferenceTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'MULTILINESTRING((50 150,50 200),(50 50,50 100))', -]; + 'value' => 'MULTILINESTRING((50 150,50 200),(50 50,50 100))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_TouchesTest.php b/tests/Functions/ST_TouchesTest.php index 014315e2..47e753b5 100644 --- a/tests/Functions/ST_TouchesTest.php +++ b/tests/Functions/ST_TouchesTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_TransScaleTest.php b/tests/Functions/ST_TransScaleTest.php index d433720e..f6f6c2e2 100644 --- a/tests/Functions/ST_TransScaleTest.php +++ b/tests/Functions/ST_TransScaleTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'LINESTRING(1.5 6 3,1.5 4 1)', -]; + 'value' => 'LINESTRING(1.5 6 3,1.5 4 1)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_TransformTest.php b/tests/Functions/ST_TransformTest.php index 52e3491a..db320bb6 100644 --- a/tests/Functions/ST_TransformTest.php +++ b/tests/Functions/ST_TransformTest.php @@ -74,8 +74,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POLYGON((-71.1776848522251 42.3902896512902,-71.1776843766326 42.3903829478009,-71.1775844305465 42.3903826677917,-71.177582592723 42.3902893647987,-71.1776848522251 42.3902896512902))', -]; + 'value' => 'POLYGON((-71.1776848522251 42.3902896512902,-71.1776843766326 42.3903829478009,-71.1775844305465 42.3903826677917,-71.177582592723 42.3902893647987,-71.1776848522251 42.3902896512902))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -104,8 +104,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 'POLYGON((-71.1776848522251 42.39028965129018,-71.17768437663261 42.390382947800894,-71.17758443054647 42.39038266779171,-71.17758259272304 42.3902893647987,-71.1776848522251 42.39028965129018))', -]; + 'value' => 'POLYGON((-71.1776848522251 42.39028965129018,-71.17768437663261 42.390382947800894,-71.17758443054647 42.39038266779171,-71.17758259272304 42.3902893647987,-71.1776848522251 42.39028965129018))', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_TranslateTest.php b/tests/Functions/ST_TranslateTest.php index f9e3fff9..ec16613e 100644 --- a/tests/Functions/ST_TranslateTest.php +++ b/tests/Functions/ST_TranslateTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'POINT(-70.01 42.37)', -]; + 'value' => 'POINT(-70.01 42.37)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_UnionTest.php b/tests/Functions/ST_UnionTest.php index cf4bb273..014d2dd1 100644 --- a/tests/Functions/ST_UnionTest.php +++ b/tests/Functions/ST_UnionTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 'MULTIPOINT(1 2,-2 3)', -]; + 'value' => 'MULTIPOINT(1 2,-2 3)', + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_WithinTest.php b/tests/Functions/ST_WithinTest.php index 7d1df067..92b8d0a4 100644 --- a/tests/Functions/ST_WithinTest.php +++ b/tests/Functions/ST_WithinTest.php @@ -71,8 +71,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => true, -]; + 'value' => true, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_XMaxTest.php b/tests/Functions/ST_XMaxTest.php index 2ef03e94..f5c2cc6b 100644 --- a/tests/Functions/ST_XMaxTest.php +++ b/tests/Functions/ST_XMaxTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 4, -]; + 'value' => 4, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_XMinTest.php b/tests/Functions/ST_XMinTest.php index 5c8a51a6..5872f60a 100644 --- a/tests/Functions/ST_XMinTest.php +++ b/tests/Functions/ST_XMinTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1, -]; + 'value' => 1, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_XTest.php b/tests/Functions/ST_XTest.php index f56dfd67..bfee3b51 100644 --- a/tests/Functions/ST_XTest.php +++ b/tests/Functions/ST_XTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 1.5, -]; + 'value' => 1.5, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_YMaxTest.php b/tests/Functions/ST_YMaxTest.php index 33afda94..973d48b3 100644 --- a/tests/Functions/ST_YMaxTest.php +++ b/tests/Functions/ST_YMaxTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 5, -]; + 'value' => 5, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_YMinTest.php b/tests/Functions/ST_YMinTest.php index b227d4cf..fd9897ea 100644 --- a/tests/Functions/ST_YMinTest.php +++ b/tests/Functions/ST_YMinTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 2, -]; + 'value' => 2, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_YTest.php b/tests/Functions/ST_YTest.php index 0249b3e0..9136caa4 100644 --- a/tests/Functions/ST_YTest.php +++ b/tests/Functions/ST_YTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 2, -]; + 'value' => 2, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ZMaxTest.php b/tests/Functions/ST_ZMaxTest.php index 2cfb94f0..9edd65b0 100644 --- a/tests/Functions/ST_ZMaxTest.php +++ b/tests/Functions/ST_ZMaxTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 6, -]; + 'value' => 6, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ZMinTest.php b/tests/Functions/ST_ZMinTest.php index b792b80b..76beb515 100644 --- a/tests/Functions/ST_ZMinTest.php +++ b/tests/Functions/ST_ZMinTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 3, -]; + 'value' => 3, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ZTest.php b/tests/Functions/ST_ZTest.php index b971ea19..f8640cf4 100644 --- a/tests/Functions/ST_ZTest.php +++ b/tests/Functions/ST_ZTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 3, -]; + 'value' => 3, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Functions/ST_ZmflagTest.php b/tests/Functions/ST_ZmflagTest.php index 011a7696..97f52d4b 100644 --- a/tests/Functions/ST_ZmflagTest.php +++ b/tests/Functions/ST_ZmflagTest.php @@ -68,8 +68,8 @@ public function testQuery1(): void }); $expected = [ - 'value' => 0, -]; + 'value' => 0, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } @@ -93,8 +93,8 @@ public function testQuery2(): void }); $expected = [ - 'value' => 3, -]; + 'value' => 3, + ]; $this->assertEqualsWithDelta($expected, $result, 0.001); } diff --git a/tests/Types/AbstractTypeTestCase.php b/tests/Types/AbstractTypeTestCase.php index 3d5fc5d9..2bd2b8b3 100644 --- a/tests/Types/AbstractTypeTestCase.php +++ b/tests/Types/AbstractTypeTestCase.php @@ -7,6 +7,8 @@ use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\AbstractTestCase; +use function sprintf; + abstract class AbstractTypeTestCase extends AbstractTestCase { protected ?Type $type = null; diff --git a/tests/fixtures/Types/GeoJsonType.php b/tests/fixtures/Types/GeoJsonType.php index dd6e0d97..75a35172 100644 --- a/tests/fixtures/Types/GeoJsonType.php +++ b/tests/fixtures/Types/GeoJsonType.php @@ -6,6 +6,8 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; +use function sprintf; + final class GeoJsonType extends GeographyType { public const NAME = 'geojson'; From 8aa0d8995c49d38df9abf1311ab492be7af12142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20H=C3=A9lias?= Date: Thu, 25 Sep 2025 23:18:08 +0200 Subject: [PATCH 17/19] feat: rework filtered spatial indexes --- psalm-baseline.xml | 2276 +------------------------------- src/Driver/Driver.php | 3 +- src/Driver/PostGISPlatform.php | 86 +- src/Schema/SchemaManager.php | 7 +- src/Schema/SpatialIndexes.php | 73 - src/Utils/Doctrine.php | 15 - 6 files changed, 89 insertions(+), 2371 deletions(-) delete mode 100644 src/Utils/Doctrine.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index b5c62589..967fffc5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,10 +1,5 @@ - - - - - - + @@ -16,2172 +11,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2197,116 +26,13 @@ - - getCreatedTables(), - array_map($filter, $schemaDiff->getAlteredTables()), - $schemaDiff->getDroppedTables(), - $schemaDiff->fromSchema, - $schemaDiff->getCreatedSchemas(), - $schemaDiff->getDroppedSchemas(), - $schemaDiff->getCreatedSequences(), - $schemaDiff->getAlteredSequences(), - $schemaDiff->getDroppedSequences(), - )]]> - getCreatedSchemas(), - $schemaDiff->getDroppedSchemas(), - $schemaDiff->getCreatedTables(), - array_map($filter, $schemaDiff->getAlteredTables()), - $schemaDiff->getDroppedTables(), - $schemaDiff->getCreatedSequences(), - $schemaDiff->getAlteredSequences(), - $schemaDiff->getDroppedSequences(), - )]]> - getOldTable()?->getName(), - $tableDiff->getAddedColumns(), - $tableDiff->getModifiedColumns(), - $tableDiff->getDroppedColumns(), - array_filter($tableDiff->getAddedIndexes(), $spatialFilter), - array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), - $tableDiff->getDroppedIndexes(), - $tableDiff->getOldTable(), - $tableDiff->getAddedForeignKeys(), - $tableDiff->getModifiedForeignKeys(), - $tableDiff->getDroppedForeignKeys(), - $tableDiff->getRenamedColumns(), - $tableDiff->getRenamedIndexes(), - )]]> - getOldTable(), - $tableDiff->getAddedColumns(), - $tableDiff->getModifiedColumns(), - $tableDiff->getDroppedColumns(), - $tableDiff->getRenamedColumns(), - array_filter($tableDiff->getAddedIndexes(), $spatialFilter), - array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), - $tableDiff->getDroppedIndexes(), - $tableDiff->getRenamedIndexes(), - $tableDiff->getAddedForeignKeys(), - $tableDiff->getModifiedForeignKeys(), - $tableDiff->getDroppedForeignKeys(), - )]]> - - - getCreatedSchemas()]]> - getCreatedTables()]]> - getDroppedSchemas()]]> - getAddedForeignKeys()]]> - getOldTable()]]> - getRenamedColumns()]]> - getOldTable()?->getName()]]> - getAddedIndexes(), $spatialFilter)]]> - getAlteredTables())]]> - - - fromSchema]]> - $idx->hasFlag('spatial'))]]> - - getOldTable()?->getName()]]> - - - getCreatedTables(), - array_map($filter, $schemaDiff->getAlteredTables()), - $schemaDiff->getDroppedTables(), - $schemaDiff->fromSchema, - $schemaDiff->getCreatedSchemas(), - $schemaDiff->getDroppedSchemas(), - $schemaDiff->getCreatedSequences(), - $schemaDiff->getAlteredSequences(), - $schemaDiff->getDroppedSequences(), - )]]> - getOldTable()?->getName(), - $tableDiff->getAddedColumns(), - $tableDiff->getModifiedColumns(), - $tableDiff->getDroppedColumns(), - array_filter($tableDiff->getAddedIndexes(), $spatialFilter), - array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), - $tableDiff->getDroppedIndexes(), - $tableDiff->getOldTable(), - $tableDiff->getAddedForeignKeys(), - $tableDiff->getModifiedForeignKeys(), - $tableDiff->getDroppedForeignKeys(), - $tableDiff->getRenamedColumns(), - $tableDiff->getRenamedIndexes(), - )]]> - - - getOldTable()]]> - - - fromSchema]]> - diff --git a/src/Driver/Driver.php b/src/Driver/Driver.php index 4c9594f2..ce988908 100644 --- a/src/Driver/Driver.php +++ b/src/Driver/Driver.php @@ -15,7 +15,6 @@ use Jsor\Doctrine\PostGIS\Types\GeographyType; use Jsor\Doctrine\PostGIS\Types\GeometryType; use Jsor\Doctrine\PostGIS\Types\PostGISType; -use Jsor\Doctrine\PostGIS\Utils\Doctrine; final class Driver extends AbstractPostgreSQLDriver { @@ -51,7 +50,7 @@ public function getDatabasePlatform(?ServerVersionProvider $versionProvider = nu public function createDatabasePlatformForVersion($version): AbstractPlatform { // Remove when DBAL v3 support is dropped. - if (Doctrine::isV3()) { + if (!class_exists(StaticServerVersionProvider::class)) { return $this->getDatabasePlatform(); } diff --git a/src/Driver/PostGISPlatform.php b/src/Driver/PostGISPlatform.php index 99d5e856..d528fe0e 100644 --- a/src/Driver/PostGISPlatform.php +++ b/src/Driver/PostGISPlatform.php @@ -29,7 +29,9 @@ public function createSchemaManager(Connection $connection): PostgreSQLSchemaMan public function getAlterSchemaSQL(SchemaDiff $diff): array { - $sql = parent::getAlterSchemaSQL(SpatialIndexes::filterSchemaDiff($diff)); + /** @var list $sql */ + $sql = parent::getAlterSchemaSQL($diff); + $sql = $this->filterSpatialIndexFromSQL($sql, $this->collectSpatialIndexNamesFromSchemaDiff($diff)); $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); @@ -113,7 +115,9 @@ public function getAlterTableSQL(TableDiff $diff): array SpatialIndexes::ensureSpatialIndexFlags($diff); - $sql = parent::getAlterTableSQL(SpatialIndexes::filterTableDiff($diff)); + /** @var list $sql */ + $sql = parent::getAlterTableSQL($diff); + $sql = $this->filterSpatialIndexFromSQL($sql, $this->collectSpatialIndexNamesFromTableDiff($diff)); foreach (SpatialIndexes::extractSpatialIndicies($diff->getAddedIndexes()) as $spatialIndex) { $sql[] = $spatialIndexSqlGenerator->getSql($spatialIndex, $table); @@ -124,14 +128,21 @@ public function getAlterTableSQL(TableDiff $diff): array $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); } + /** @psalm-suppress DeprecatedMethod */ + $modifiedColumns = method_exists($diff, 'getChangedColumns') + ? $diff->getChangedColumns() + : @$diff->getModifiedColumns(); + /** @var ColumnDiff $columnDiff */ - foreach ($diff->getModifiedColumns() as $columnDiff) { + foreach ($modifiedColumns as $columnDiff) { $oldColumn = $columnDiff->getOldColumn(); $newColumn = $columnDiff->getNewColumn(); + /** @var int|null $oldSrid */ $oldSrid = $oldColumn->hasPlatformOption('srid') ? $oldColumn->getPlatformOption('srid') : null; + /** @var int|null $newSrid */ $newSrid = $newColumn->hasPlatformOption('srid') ? $newColumn->getPlatformOption('srid') : null; - if (!$oldSrid && !$newSrid) { + if (null === $oldSrid && null === $newSrid) { continue; } @@ -140,11 +151,76 @@ public function getAlterTableSQL(TableDiff $diff): array "SELECT UpdateGeometrySRID('%s', '%s', %d)", $table->getName(), $newColumn->getName(), - (int) $newSrid + $newSrid ); } } return $sql; } + + /** + * @param list $sql Generated standard SQL + * @param list $spatialIndexNames Names of spatial indexes to filter out + * + * @return list SQL without spatial index statements + */ + private function filterSpatialIndexFromSQL(array $sql, array $spatialIndexNames): array + { + if (empty($spatialIndexNames)) { + return $sql; + } + + $filtered = array_filter($sql, function (string $sqlStatement) use ($spatialIndexNames) { + foreach ($spatialIndexNames as $indexName) { + if (false !== stripos($sqlStatement, $indexName)) { + return false; + } + } + + return true; + }); + + return array_values($filtered); + } + + /** + * @param SchemaDiff $diff Schema diff + * + * @return list Names of spatial indexes + */ + private function collectSpatialIndexNamesFromSchemaDiff(SchemaDiff $diff): array + { + $spatialIndexNames = []; + + foreach ($diff->getAlteredTables() as $tableDiff) { + SpatialIndexes::ensureSpatialIndexFlags($tableDiff); + $spatialIndexNames = array_merge( + $spatialIndexNames, + $this->collectSpatialIndexNamesFromTableDiff($tableDiff) + ); + } + + return $spatialIndexNames; + } + + /** + * @param TableDiff $diff Table diff + * + * @return list Name of spatial indexes + */ + private function collectSpatialIndexNamesFromTableDiff(TableDiff $diff): array + { + $spatialIndexNames = []; + + foreach (SpatialIndexes::extractSpatialIndicies($diff->getAddedIndexes()) as $index) { + $spatialIndexNames[] = $index->getName(); + } + + foreach (SpatialIndexes::extractSpatialIndicies($diff->getModifiedIndexes()) as $index) { + $spatialIndexNames[] = $index->getName(); + } + + return $spatialIndexNames; + } } diff --git a/src/Schema/SchemaManager.php b/src/Schema/SchemaManager.php index e5edac40..d80f6adc 100644 --- a/src/Schema/SchemaManager.php +++ b/src/Schema/SchemaManager.php @@ -22,7 +22,12 @@ public function alterTable(TableDiff $tableDiff): void { $oldTable = $tableDiff->getOldTable(); - foreach ($tableDiff->getModifiedColumns() as $columnDiff) { + /** @psalm-suppress DeprecatedMethod */ + $modifiedColumns = method_exists($tableDiff, 'getChangedColumns') + ? $tableDiff->getChangedColumns() + : @$tableDiff->getModifiedColumns(); + + foreach ($modifiedColumns as $columnDiff) { if (!$columnDiff->getNewColumn()->getType() instanceof PostGISType) { continue; } diff --git a/src/Schema/SpatialIndexes.php b/src/Schema/SpatialIndexes.php index 97ceaa0f..f2c343a2 100644 --- a/src/Schema/SpatialIndexes.php +++ b/src/Schema/SpatialIndexes.php @@ -5,11 +5,9 @@ namespace Jsor\Doctrine\PostGIS\Schema; use Doctrine\DBAL\Schema\Index; -use Doctrine\DBAL\Schema\SchemaDiff; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; use Jsor\Doctrine\PostGIS\Types\PostGISType; -use Jsor\Doctrine\PostGIS\Utils\Doctrine; final class SpatialIndexes { @@ -21,77 +19,6 @@ public static function extractSpatialIndicies(array $indicies): array return array_filter($indicies, static fn (Index $idx) => $idx->hasFlag('spatial')); } - public static function filterSchemaDiff(SchemaDiff $schemaDiff): SchemaDiff - { - $filter = static fn (TableDiff $diff): TableDiff => self::filterTableDiff($diff); - - if (Doctrine::isV3()) { - return new SchemaDiff( - $schemaDiff->getCreatedTables(), - array_map($filter, $schemaDiff->getAlteredTables()), - $schemaDiff->getDroppedTables(), - $schemaDiff->fromSchema, - $schemaDiff->getCreatedSchemas(), - $schemaDiff->getDroppedSchemas(), - $schemaDiff->getCreatedSequences(), - $schemaDiff->getAlteredSequences(), - $schemaDiff->getDroppedSequences(), - ); - } - - return new SchemaDiff( - $schemaDiff->getCreatedSchemas(), - $schemaDiff->getDroppedSchemas(), - $schemaDiff->getCreatedTables(), - array_map($filter, $schemaDiff->getAlteredTables()), - $schemaDiff->getDroppedTables(), - $schemaDiff->getCreatedSequences(), - $schemaDiff->getAlteredSequences(), - $schemaDiff->getDroppedSequences(), - ); - } - - /** - * Filter spatial indexes from a TableDiff to prevent duplicate index SQL generation. - */ - public static function filterTableDiff(TableDiff $tableDiff): TableDiff - { - $spatialFilter = static fn (Index $idx): bool => !$idx->hasFlag('spatial'); - - if (Doctrine::isV3()) { - return new TableDiff( - (string) $tableDiff->getOldTable()?->getName(), - $tableDiff->getAddedColumns(), - $tableDiff->getModifiedColumns(), - $tableDiff->getDroppedColumns(), - array_filter($tableDiff->getAddedIndexes(), $spatialFilter), - array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), - $tableDiff->getDroppedIndexes(), - $tableDiff->getOldTable(), - $tableDiff->getAddedForeignKeys(), - $tableDiff->getModifiedForeignKeys(), - $tableDiff->getDroppedForeignKeys(), - $tableDiff->getRenamedColumns(), - $tableDiff->getRenamedIndexes(), - ); - } - - return new TableDiff( - $tableDiff->getOldTable(), - $tableDiff->getAddedColumns(), - $tableDiff->getModifiedColumns(), - $tableDiff->getDroppedColumns(), - $tableDiff->getRenamedColumns(), - array_filter($tableDiff->getAddedIndexes(), $spatialFilter), - array_filter($tableDiff->getModifiedIndexes(), $spatialFilter), - $tableDiff->getDroppedIndexes(), - $tableDiff->getRenamedIndexes(), - $tableDiff->getAddedForeignKeys(), - $tableDiff->getModifiedForeignKeys(), - $tableDiff->getDroppedForeignKeys(), - ); - } - /** * Ensure the 'spatial' flag is set on PostGIS columns. */ diff --git a/src/Utils/Doctrine.php b/src/Utils/Doctrine.php deleted file mode 100644 index b3bcfe1d..00000000 --- a/src/Utils/Doctrine.php +++ /dev/null @@ -1,15 +0,0 @@ - Date: Tue, 7 Oct 2025 23:25:22 +0200 Subject: [PATCH 18/19] feat: rework platform & schema manager --- README.md | 12 +- docs/symfony.md | 10 +- psalm-baseline.xml | 21 -- src/Driver/Driver.php | 15 +- src/Driver/Middleware.php | 14 ++ src/Driver/PostGISPlatform.php | 211 ++++++------------ src/Schema/SchemaManager.php | 86 +++---- src/Schema/SpatialIndexSqlGenerator.php | 45 ---- src/Schema/SpatialIndexes.php | 68 ------ tests/Schema/SpatialIndexSqlGeneratorTest.php | 61 ----- tests/Schema/SpatialIndexesTest.php | 143 ------------ 11 files changed, 136 insertions(+), 550 deletions(-) delete mode 100644 src/Schema/SpatialIndexSqlGenerator.php delete mode 100644 src/Schema/SpatialIndexes.php delete mode 100644 tests/Schema/SpatialIndexSqlGeneratorTest.php delete mode 100644 tests/Schema/SpatialIndexesTest.php diff --git a/README.md b/README.md index 686a709a..cb57840d 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,12 @@ Supported Versions The following table shows the versions which are officially supported by this library. -| Dependency | Supported Versions | -|:--------------|:--------------------| -| PostGIS | 3.0 and 3.1 | -| PostgreSQL | 11, 12 and 13 | -| Doctrine ORM | ^2.9 | -| Doctrine DBAL | ^2.13 and ^3.1 | +| Dependency | Supported Versions | +|:--------------|:-------------------| +| PostGIS | 3.0 and 3.1 | +| PostgreSQL | 11, 12 and 13 | +| Doctrine ORM | ^2.19 and ^3.0 | +| Doctrine DBAL | ^3.7 and ^4.0 | Installation -- diff --git a/docs/symfony.md b/docs/symfony.md index cc04461e..34f67398 100644 --- a/docs/symfony.md +++ b/docs/symfony.md @@ -17,17 +17,11 @@ in `config/packages/jsor_doctrine_postgis.yaml`. ```yaml services: - Jsor\Doctrine\PostGIS\Schema\SchemaManagerFactory: - Jsor\Doctrine\PostGIS\Event\ORMSchemaEventListener: tags: [{ name: doctrine.event_listener, event: postGenerateSchemaTable, connection: default }] Jsor\Doctrine\PostGIS\Driver\Middleware: tags: [ doctrine.middleware ] - -doctrine: - dbal: - schema_manager_factory: Jsor\Doctrine\PostGIS\Schema\SchemaManagerFactory ``` ### Database Types @@ -48,6 +42,10 @@ doctrine: commented: false ``` +> **Note:** The PostgreSQL native `geometry` and `geography` types are automatically +> mapped to Doctrine types during schema introspection. You don't need to add them +> to the `mapping_types` section. + ### DQL Functions To use the DQL functions provided by this library, they must be configured in diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 967fffc5..a7e678bf 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,16 +1,5 @@ - - - - - - - - - - - @@ -25,14 +14,4 @@ _conn]]> - - - - $idx->hasFlag('spatial'))]]> - - - - - - diff --git a/src/Driver/Driver.php b/src/Driver/Driver.php index ce988908..0da326e4 100644 --- a/src/Driver/Driver.php +++ b/src/Driver/Driver.php @@ -11,10 +11,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\ServerVersionProvider; -use Doctrine\DBAL\Types\Type; -use Jsor\Doctrine\PostGIS\Types\GeographyType; -use Jsor\Doctrine\PostGIS\Types\GeometryType; -use Jsor\Doctrine\PostGIS\Types\PostGISType; final class Driver extends AbstractPostgreSQLDriver { @@ -27,16 +23,7 @@ public function __construct(DBAL\Driver $decorated) public function connect(array $params): DBAL\Driver\Connection { - $connection = $this->decorated->connect($params); - if (!Type::hasType(PostGISType::GEOMETRY)) { - Type::addType(PostGISType::GEOMETRY, GeometryType::class); - } - - if (!Type::hasType(PostGISType::GEOGRAPHY)) { - Type::addType(PostGISType::GEOGRAPHY, GeographyType::class); - } - - return $connection; + return $this->decorated->connect($params); } public function getDatabasePlatform(?ServerVersionProvider $versionProvider = null): PostgreSQLPlatform diff --git a/src/Driver/Middleware.php b/src/Driver/Middleware.php index 59ba7076..b74fc5f4 100644 --- a/src/Driver/Middleware.php +++ b/src/Driver/Middleware.php @@ -5,11 +5,25 @@ namespace Jsor\Doctrine\PostGIS\Driver; use Doctrine\DBAL; +use Doctrine\DBAL\Types\Type; +use Jsor\Doctrine\PostGIS\Types\GeographyType; +use Jsor\Doctrine\PostGIS\Types\GeometryType; +use Jsor\Doctrine\PostGIS\Types\PostGISType; final class Middleware implements DBAL\Driver\Middleware { public function wrap(DBAL\Driver $driver): DBAL\Driver { + // Register PostGIS types once at middleware level (global registry) + // This is done here rather than in connect() to avoid repeated registration + if (!Type::hasType(PostGISType::GEOMETRY)) { + Type::addType(PostGISType::GEOMETRY, GeometryType::class); + } + + if (!Type::hasType(PostGISType::GEOGRAPHY)) { + Type::addType(PostGISType::GEOGRAPHY, GeographyType::class); + } + return new Driver($driver); } } diff --git a/src/Driver/PostGISPlatform.php b/src/Driver/PostGISPlatform.php index d528fe0e..847717af 100644 --- a/src/Driver/PostGISPlatform.php +++ b/src/Driver/PostGISPlatform.php @@ -7,18 +7,29 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\ColumnDiff; +use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; -use Doctrine\DBAL\Schema\SchemaDiff; -use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; +use InvalidArgumentException; use Jsor\Doctrine\PostGIS\Schema\SchemaManager; -use Jsor\Doctrine\PostGIS\Schema\SpatialIndexes; -use Jsor\Doctrine\PostGIS\Schema\SpatialIndexSqlGenerator; +use Jsor\Doctrine\PostGIS\Types\PostGISType; +use function count; +use function implode; use function sprintf; final class PostGISPlatform extends PostgreSQLPlatform { + protected function initializeDoctrineTypeMappings(): void + { + parent::initializeDoctrineTypeMappings(); + + // Map PostgreSQL native geometry/geography types to Doctrine PostGIS types + // This is essential for schema introspection to work correctly + $this->doctrineTypeMapping['geometry'] = PostGISType::GEOMETRY; + $this->doctrineTypeMapping['geography'] = PostGISType::GEOGRAPHY; + } + public function createSchemaManager(Connection $connection): PostgreSQLSchemaManager { /** @var PostgreSQLPlatform $platform */ @@ -27,106 +38,79 @@ public function createSchemaManager(Connection $connection): PostgreSQLSchemaMan return new SchemaManager($connection, $platform); } - public function getAlterSchemaSQL(SchemaDiff $diff): array + public function getCreateIndexSQL(Index $index, $table): string { - /** @var list $sql */ - $sql = parent::getAlterSchemaSQL($diff); - $sql = $this->filterSpatialIndexFromSQL($sql, $this->collectSpatialIndexNamesFromSchemaDiff($diff)); - - $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); - - foreach ($diff->getAlteredTables() as $tableDiff) { - $table = $tableDiff->getOldTable(); - - SpatialIndexes::ensureSpatialIndexFlags($tableDiff); - - foreach (SpatialIndexes::extractSpatialIndicies($tableDiff->getAddedIndexes()) as $index) { - $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); - } - - foreach (SpatialIndexes::extractSpatialIndicies($tableDiff->getModifiedIndexes()) as $index) { - $sql[] = $this->getDropIndexSQL($index->getName(), $table->getName()); - $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); - } + // Standard PostgreSQL index + if (!$index->hasFlag('spatial')) { + return parent::getCreateIndexSQL($index, $table); } - return $sql; - } + // Handle spatial indexes with GIST + $name = $index->getQuotedName($this); + $columns = $index->getColumns(); - public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES): array - { - SpatialIndexes::ensureSpatialIndexFlags($table); + if (0 === count($columns)) { + throw new InvalidArgumentException(sprintf( + 'Incomplete or invalid index definition %s on table %s', + $name, + $table, + )); + } - $spatialIndexes = SpatialIndexes::extractSpatialIndicies($table->getIndexes()); - foreach ($spatialIndexes as $index) { - $table->dropIndex($index->getName()); + if ($index->isPrimary()) { + return $this->getCreatePrimaryKeySQL($index, $table); } - $sql = parent::getCreateTableSQL($table, $createFlags); + $query = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $table; + $query .= ' USING gist(' . implode(', ', $index->getQuotedColumns($this)) . ')'; - $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); - foreach ($spatialIndexes as $index) { - $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); - } + // Support partial indexes (WHERE clause) + $query .= $this->getPartialIndexSQL($index); - return $sql; + return $query; } - public function getCreateTablesSQL(array $tables): array + /** + * @param string|Index $nameOrIndex + * @param Index|null $index + * + * @psalm-suppress ParamNameMismatch + * @psalm-suppress PossiblyNullReference + */ + public function getIndexDeclarationSQL($nameOrIndex, ?Index $index = null): string { - $sql = []; - $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); - - /** @var Table $table */ - foreach ($tables as $table) { - SpatialIndexes::ensureSpatialIndexFlags($table); - - $spatialIndexes = SpatialIndexes::extractSpatialIndicies($table->getIndexes()); - foreach ($spatialIndexes as $index) { - $table->dropIndex($index->getName()); - } - $sql = [...$sql, ...$this->getCreateTableWithoutForeignKeysSQL($table)]; - - foreach ($spatialIndexes as $index) { - $table->addIndex($index->getColumns(), $index->getName(), $index->getFlags(), $index->getOptions()); - } + // DBAL 4.x: single Index parameter + // DBAL 3.x: name + Index parameters + if ($nameOrIndex instanceof Index) { + $actualIndex = $nameOrIndex; + } else { + $actualIndex = $index; + } - foreach ($spatialIndexes as $spatialIndex) { - $sql[] = $spatialIndexSqlGenerator->getSql($spatialIndex, $table); - } + // Spatial indexes cannot be declared inline in CREATE TABLE + // They will be created separately via getCreateIndexSQL + if ($actualIndex->hasFlag('spatial')) { + return ''; } - foreach ($tables as $table) { - foreach ($table->getForeignKeys() as $foreignKey) { - $sql[] = $this->getCreateForeignKeySQL( - $foreignKey, - $table->getQuotedName($this), - ); - } + /** @psalm-suppress InternalMethod, InvalidArgument */ + if ($nameOrIndex instanceof Index) { + // DBAL 4.x + return parent::getIndexDeclarationSQL($nameOrIndex); } - return $sql; + // DBAL 3.x + /** @psalm-suppress InternalMethod, InvalidArgument */ + return parent::getIndexDeclarationSQL($nameOrIndex, $actualIndex); } public function getAlterTableSQL(TableDiff $diff): array { - $table = $diff->getOldTable(); - $spatialIndexSqlGenerator = new SpatialIndexSqlGenerator($this); - - SpatialIndexes::ensureSpatialIndexFlags($diff); - - /** @var list $sql */ + // getCreateIndexSQL will handle spatial indexes with USING gist automatically $sql = parent::getAlterTableSQL($diff); - $sql = $this->filterSpatialIndexFromSQL($sql, $this->collectSpatialIndexNamesFromTableDiff($diff)); - foreach (SpatialIndexes::extractSpatialIndicies($diff->getAddedIndexes()) as $spatialIndex) { - $sql[] = $spatialIndexSqlGenerator->getSql($spatialIndex, $table); - } - - foreach (SpatialIndexes::extractSpatialIndicies($diff->getModifiedIndexes()) as $index) { - $sql[] = $this->getDropIndexSQL($index->getName(), $table->getName()); - $sql[] = $spatialIndexSqlGenerator->getSql($index, $table); - } + // Handle SRID updates for spatial columns + $table = $diff->getOldTable(); /** @psalm-suppress DeprecatedMethod */ $modifiedColumns = method_exists($diff, 'getChangedColumns') @@ -158,69 +142,4 @@ public function getAlterTableSQL(TableDiff $diff): array return $sql; } - - /** - * @param list $sql Generated standard SQL - * @param list $spatialIndexNames Names of spatial indexes to filter out - * - * @return list SQL without spatial index statements - */ - private function filterSpatialIndexFromSQL(array $sql, array $spatialIndexNames): array - { - if (empty($spatialIndexNames)) { - return $sql; - } - - $filtered = array_filter($sql, function (string $sqlStatement) use ($spatialIndexNames) { - foreach ($spatialIndexNames as $indexName) { - if (false !== stripos($sqlStatement, $indexName)) { - return false; - } - } - - return true; - }); - - return array_values($filtered); - } - - /** - * @param SchemaDiff $diff Schema diff - * - * @return list Names of spatial indexes - */ - private function collectSpatialIndexNamesFromSchemaDiff(SchemaDiff $diff): array - { - $spatialIndexNames = []; - - foreach ($diff->getAlteredTables() as $tableDiff) { - SpatialIndexes::ensureSpatialIndexFlags($tableDiff); - $spatialIndexNames = array_merge( - $spatialIndexNames, - $this->collectSpatialIndexNamesFromTableDiff($tableDiff) - ); - } - - return $spatialIndexNames; - } - - /** - * @param TableDiff $diff Table diff - * - * @return list Name of spatial indexes - */ - private function collectSpatialIndexNamesFromTableDiff(TableDiff $diff): array - { - $spatialIndexNames = []; - - foreach (SpatialIndexes::extractSpatialIndicies($diff->getAddedIndexes()) as $index) { - $spatialIndexNames[] = $index->getName(); - } - - foreach (SpatialIndexes::extractSpatialIndicies($diff->getModifiedIndexes()) as $index) { - $spatialIndexNames[] = $index->getName(); - } - - return $spatialIndexNames; - } } diff --git a/src/Schema/SchemaManager.php b/src/Schema/SchemaManager.php index d80f6adc..248e8d36 100644 --- a/src/Schema/SchemaManager.php +++ b/src/Schema/SchemaManager.php @@ -4,11 +4,11 @@ namespace Jsor\Doctrine\PostGIS\Schema; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; -use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\Type; use Jsor\Doctrine\PostGIS\Types\GeographyType; @@ -52,15 +52,6 @@ public function alterTable(TableDiff $tableDiff): void parent::alterTable($tableDiff); } - public function introspectTable(string $name): Table - { - $table = parent::introspectTable($name); - - SpatialIndexes::ensureSpatialIndexFlags($table); - - return $table; - } - /** * @param string $table * @@ -89,22 +80,22 @@ public function listSpatialIndexes(string $table): array [, $table] = explode('.', $table); } - $sql = "SELECT distinct i.relname, d.indkey, pg_get_indexdef(d.indexrelid) AS inddef, t.oid - FROM pg_class t - INNER JOIN pg_index d ON t.oid = d.indrelid - INNER JOIN pg_class i ON d.indexrelid = i.oid - WHERE i.relkind = 'i' + $sql = << $tableIndexes */ $tableIndexes = $this->getConnection()->fetchAllAssociative( $sql, - [ - $this->trimQuotes($table), - ] + ['table' => $this->trimQuotes($table)] ); $indexes = []; @@ -113,16 +104,22 @@ public function listSpatialIndexes(string $table): array continue; } - $sql = "SELECT a.attname, t.typname - FROM pg_attribute a, pg_type t - WHERE a.attrelid = {$row['oid']} - AND a.attnum IN (" . implode(',', explode(' ', $row['indkey'])) . ') - AND a.atttypid = t.oid'; + $keyPositions = array_map('intval', explode(' ', $row['indkey'])); - $stmt = $this->getConnection()->executeQuery($sql); + $sql = << $indexColumns */ - $indexColumns = $stmt->fetchAllAssociative(); + $indexColumns = $this->getConnection()->fetchAllAssociative( + $sql, + ['oid' => (int) $row['oid'], 'positions' => $keyPositions], + ['positions' => ArrayParameterType::INTEGER] + ); foreach ($indexColumns as $indexRow) { if ('geometry' !== $indexRow['typname'] @@ -147,17 +144,19 @@ public function getGeometrySpatialColumnInfo(string $table, string $column): ?ar [, $table] = explode('.', $table); } - $sql = 'SELECT coord_dimension, srid, type - FROM geometry_columns - WHERE f_table_name = ? - AND f_geometry_column = ?'; + $sql = <<getConnection()->fetchAssociative( $sql, [ - $this->trimQuotes($table), - $this->trimQuotes($column), + 'table' => $this->trimQuotes($table), + 'column' => $this->trimQuotes($column), ] ); @@ -174,17 +173,19 @@ public function getGeographySpatialColumnInfo(string $table, string $column): ?a [, $table] = explode('.', $table); } - $sql = 'SELECT coord_dimension, srid, type - FROM geography_columns - WHERE f_table_name = ? - AND f_geography_column = ?'; + $sql = <<getConnection()->fetchAssociative( $sql, [ - $this->trimQuotes($table), - $this->trimQuotes($column), + 'table' => $this->trimQuotes($table), + 'column' => $this->trimQuotes($column), ] ); @@ -195,6 +196,11 @@ public function getGeographySpatialColumnInfo(string $table, string $column): ?a return $this->buildSpatialColumnInfo($row); } + public function createPostGISExtension(): void + { + $this->getConnection()->executeStatement('CREATE EXTENSION IF NOT EXISTS postgis'); + } + /** * @param string $table * @param string $database diff --git a/src/Schema/SpatialIndexSqlGenerator.php b/src/Schema/SpatialIndexSqlGenerator.php deleted file mode 100644 index af508c3a..00000000 --- a/src/Schema/SpatialIndexSqlGenerator.php +++ /dev/null @@ -1,45 +0,0 @@ -platform = $platform; - } - - public function getSql(Index $index, Table|Identifier $table): string - { - $columns = $index->getQuotedColumns($this->platform); - - if (0 === count($columns)) { - throw new InvalidArgumentException("Incomplete definition. 'columns' required."); - } - - $tableName = $table->getQuotedName($this->platform); - - if ($index->isPrimary()) { - return $this->platform->getCreatePrimaryKeySQL($index, $tableName); - } - - $name = $index->getQuotedName($this->platform); - - $query = 'CREATE INDEX ' . $name . ' ON ' . $tableName; - $query .= ' USING gist(' . implode(', ', $index->getQuotedColumns($this->platform)) . ')'; - - return $query; - } -} diff --git a/src/Schema/SpatialIndexes.php b/src/Schema/SpatialIndexes.php deleted file mode 100644 index f2c343a2..00000000 --- a/src/Schema/SpatialIndexes.php +++ /dev/null @@ -1,68 +0,0 @@ - $idx->hasFlag('spatial')); - } - - /** - * Ensure the 'spatial' flag is set on PostGIS columns. - */ - public static function ensureSpatialIndexFlags(Table|TableDiff $table): void - { - if ($table instanceof Table) { - static::applySpatialIndexFlag($table, $table->getIndexes()); - - return; - } - - $tableDiff = $table; - $table = $tableDiff->getOldTable(); - if (!$table) { - return; - } - - static::applySpatialIndexFlag($table, $tableDiff->getAddedIndexes()); - static::applySpatialIndexFlag($table, $tableDiff->getModifiedIndexes()); - } - - /** @return Index[] */ - private static function applySpatialIndexFlag(Table $table, array $indexes): array - { - $spatialIndexes = []; - - /** @var Index $index */ - foreach ($indexes as $index) { - foreach ($index->getColumns() as $columnName) { - if (!$table->hasColumn($columnName)) { - continue; - } - - $column = $table->getColumn($columnName); - if ($column->getType() instanceof PostGISType) { - if (!$index->hasFlag('spatial')) { - $index->addFlag('spatial'); - } - - $spatialIndexes[$index->getName()] = $index; - } - } - } - - return array_values($spatialIndexes); - } -} diff --git a/tests/Schema/SpatialIndexSqlGeneratorTest.php b/tests/Schema/SpatialIndexSqlGeneratorTest.php deleted file mode 100644 index f0d4cf45..00000000 --- a/tests/Schema/SpatialIndexSqlGeneratorTest.php +++ /dev/null @@ -1,61 +0,0 @@ -addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - yield 'Spatial index' => [ - new Index('linestring_idx', ['linestring'], false, false, ['spatial']), - $table, - 'CREATE INDEX linestring_idx ON points USING gist(linestring)', - ]; - - yield 'Primary index' => [ - new Index('linestring_idx', ['linestring'], false, true, ['spatial']), - $table, - 'ALTER TABLE points ADD PRIMARY KEY (linestring)', - ]; - } - - /** @dataProvider providerGetSql */ - public function testGetSql(Index $index, Table|Identifier $table, string $expected): void - { - $generator = new SpatialIndexSqlGenerator(new PostGISPlatform()); - - static::assertSame($expected, $generator->getSql($index, $table)); - } - - public function testGetSqlThrowExceptionEmptyColumns(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Incomplete definition. 'columns' required"); - - $generator = new SpatialIndexSqlGenerator(new PostGISPlatform()); - $table = new Table('points'); - $table->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $index = new Index('linestring_idx', [], false, false, ['spatial']); - - $generator->getSql($index, $table); - } -} diff --git a/tests/Schema/SpatialIndexesTest.php b/tests/Schema/SpatialIndexesTest.php deleted file mode 100644 index a65c620e..00000000 --- a/tests/Schema/SpatialIndexesTest.php +++ /dev/null @@ -1,143 +0,0 @@ -addColumn('name', 'string', ['length' => 42]); - $table->addColumn('point', 'geometry', ['platformOptions' => ['geometry_type' => 'point', 'srid' => 3785]]); - $table->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - - return $table; - }; - - $fromTable = $makeTable(); - $toTable = $makeTable(); - $toTable->addIndex(['name'], 'name_idx'); - $toTable->addIndex(['linestring'], 'linestring_idx', ['spatial']); - - yield 'Added spatial' => [$comparator->compareTables($fromTable, $toTable), 1, 0]; - - $fromTable = $makeTable(); - $fromTable->addIndex(['name'], 'name_idx', []); - $fromTable->addIndex(['point'], 'point_idx', []); - - $toTable = $makeTable(); - $toTable->addIndex(['name'], 'name_idx'); - $toTable->addIndex(['point', 'linestring'], 'point_idx'); - $toTable->addIndex(['linestring'], 'linestring_idx', ['spatial']); - - yield 'Changed spatial' => [$comparator->compareTables($fromTable, $toTable), 0, 1]; - } - - /** @dataProvider providerFilterTableDiff */ - public function testFilterTableDiff(TableDiff $tableDiff, int $addedIndexes, int $modifiedIndexes): void - { - $tableDiff = SpatialIndexes::filterTableDiff($tableDiff); - - static::assertCount($addedIndexes, $tableDiff->getAddedIndexes(), 'Incorrect added index count'); - static::assertCount($modifiedIndexes, $tableDiff->getModifiedIndexes(), 'Incorrect modified index count'); - } - - public function providerEnsureTableFlag(): iterable - { - $baseTable = new Table('points'); - $baseTable->addColumn('name', 'string', ['length' => 42]); - $baseTable->addIndex(['name'], 'name_idx', []); - $baseTable->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - - $table = clone $baseTable; - $table->addIndex(['linestring'], 'linestring_idx', ['spatial']); - - yield 'With spatial flag' => [$table]; - - $table = clone $baseTable; - $table->addIndex(['linestring'], 'linestring_idx', []); - - yield 'Without spatial flag' => [$table]; - } - - /** @dataProvider providerEnsureTableFlag */ - public function testEnsureTableFlag(Table $table): void - { - SpatialIndexes::ensureSpatialIndexFlags($table); - $spatialIndexes = SpatialIndexes::extractSpatialIndicies($table->getIndexes()); - - static::assertCount(1, $spatialIndexes); - static::assertSame('linestring_idx', $spatialIndexes['linestring_idx']->getName()); - static::assertTrue($spatialIndexes['linestring_idx']->hasFlag('spatial')); - } - - public function providerEnsureSpatialIndexFlags(): iterable - { - static::_registerTypes(); - - $comparator = new Comparator(new PostGISPlatform()); - - $fromTable = new Table('points'); - - $toTable = new Table('points'); - $toTable->addColumn('linestring', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $toTable->addIndex(['linestring'], 'linestring_idx', ['spatial']); - - $tableDiff = $comparator->compareTables($fromTable, $toTable); - - yield 'Added column and index' => [1, $tableDiff]; - - $fromTable = new Table('points'); - $fromTable->addColumn('linestring_1', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $fromTable->addColumn('linestring_2', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $fromTable->addIndex(['linestring_1'], 'linestring_idx', []); - - $toTable = new Table('points'); - $toTable->addColumn('linestring_1', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $toTable->addColumn('linestring_2', 'geometry', ['platformOptions' => ['geometry_type' => 'linestring', 'srid' => 3785]]); - $toTable->addIndex(['linestring_1', 'linestring_2'], 'linestring_idx', ['spatial']); - - $tableDiff = $comparator->compareTables($fromTable, $toTable); - - yield 'Changed index' => [1, $tableDiff]; - } - - /** @dataProvider providerEnsureSpatialIndexFlags */ - public function testEnsureSpatialIndexFlags(int $expected, TableDiff $tableDiff): void - { - SpatialIndexes::ensureSpatialIndexFlags($tableDiff); - $spatialIndexes = array_merge( - SpatialIndexes::extractSpatialIndicies($tableDiff->getAddedIndexes()), - SpatialIndexes::extractSpatialIndicies($tableDiff->getModifiedIndexes()), - ); - - static::assertCount($expected, $spatialIndexes); - - foreach ($spatialIndexes as $spatialIndex) { - static::assertTrue($spatialIndex->hasFlag('spatial'), 'Missing spatial flag'); - } - } -} From c1fc2ccb83819770cd63d76122e1fe9be061028b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20H=C3=A9lias?= Date: Wed, 8 Oct 2025 00:49:38 +0200 Subject: [PATCH 19/19] fix: prevent BC --- composer.json | 3 +- psalm.xml | 2 + src/Driver/PostGISPlatform.php | 8 +- src/Event/DBALSchemaEventSubscriber.php | 277 ++++++++++++++++++ src/Event/ORMSchemaEventListener.php | 25 +- src/Event/ORMSchemaEventSubscriber.php | 41 +++ ...chemaEventSubscriberCompatibilityTrait.php | 36 +++ 7 files changed, 364 insertions(+), 28 deletions(-) create mode 100644 src/Event/DBALSchemaEventSubscriber.php create mode 100644 src/Event/ORMSchemaEventSubscriber.php create mode 100644 src/Event/ORMSchemaEventSubscriberCompatibilityTrait.php diff --git a/composer.json b/composer.json index bf8ec627..5311fc7e 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ ], "require": { "php": "^8.1", - "doctrine/dbal": "^3.7 || ^4.0" + "doctrine/dbal": "^3.7 || ^4.0", + "doctrine/deprecations": "^0.5.3 || ^1.0" }, "require-dev": { "doctrine/collections": "^2.0 || ^3.0", diff --git a/psalm.xml b/psalm.xml index 58594fed..5153dcce 100644 --- a/psalm.xml +++ b/psalm.xml @@ -13,6 +13,8 @@ + + diff --git a/src/Driver/PostGISPlatform.php b/src/Driver/PostGISPlatform.php index 847717af..478e75af 100644 --- a/src/Driver/PostGISPlatform.php +++ b/src/Driver/PostGISPlatform.php @@ -38,6 +38,9 @@ public function createSchemaManager(Connection $connection): PostgreSQLSchemaMan return new SchemaManager($connection, $platform); } + /** + * @param string $table + */ public function getCreateIndexSQL(Index $index, $table): string { // Standard PostgreSQL index @@ -72,10 +75,11 @@ public function getCreateIndexSQL(Index $index, $table): string /** * @param string|Index $nameOrIndex - * @param Index|null $index * * @psalm-suppress ParamNameMismatch * @psalm-suppress PossiblyNullReference + * @psalm-suppress InternalMethod + * @psalm-suppress InvalidArgument */ public function getIndexDeclarationSQL($nameOrIndex, ?Index $index = null): string { @@ -93,14 +97,12 @@ public function getIndexDeclarationSQL($nameOrIndex, ?Index $index = null): stri return ''; } - /** @psalm-suppress InternalMethod, InvalidArgument */ if ($nameOrIndex instanceof Index) { // DBAL 4.x return parent::getIndexDeclarationSQL($nameOrIndex); } // DBAL 3.x - /** @psalm-suppress InternalMethod, InvalidArgument */ return parent::getIndexDeclarationSQL($nameOrIndex, $actualIndex); } diff --git a/src/Event/DBALSchemaEventSubscriber.php b/src/Event/DBALSchemaEventSubscriber.php new file mode 100644 index 00000000..18bc7c64 --- /dev/null +++ b/src/Event/DBALSchemaEventSubscriber.php @@ -0,0 +1,277 @@ +getTable(); + + $spatialIndexes = []; + + foreach ($table->getIndexes() as $index) { + if (!$index->hasFlag('spatial')) { + continue; + } + + $spatialIndexes[] = $index; + $table->dropIndex($index->getName()); + } + + if (0 === count($spatialIndexes)) { + return; + } + + // Avoid this listener from creating a loop on this table when calling + // $platform->getCreateTableSQL() later + if ($table->hasOption(self::PROCESSING_TABLE_FLAG)) { + return; + } + + $table->addOption(self::PROCESSING_TABLE_FLAG, true); + + $platform = $args->getPlatform(); + + foreach ($platform->getCreateTableSQL($table) as $sql) { + $args->addSql($sql); + } + + foreach ($spatialIndexes as $index) { + $args->addSql($this->getIndexSql($platform, $index, $table)); + } + + $args->preventDefault(); + } + + public function onSchemaAlterTable(SchemaAlterTableEventArgs $args): void + { + $platform = $args->getPlatform(); + $diff = $args->getTableDiff(); + + $spatialIndexes = []; + $addedIndexes = []; + $changedIndexes = []; + + foreach ($diff->addedIndexes as $index) { + if (!$index->hasFlag('spatial')) { + $addedIndexes[] = $index; + } else { + $spatialIndexes[] = $index; + } + } + + foreach ($diff->changedIndexes as $index) { + if (!$index->hasFlag('spatial')) { + $changedIndexes[] = $index; + } else { + $diff->removedIndexes[] = $index; + $spatialIndexes[] = $index; + } + } + + $diff->addedIndexes = $addedIndexes; + $diff->changedIndexes = $changedIndexes; + + $table = new Identifier(false !== $diff->newName ? $diff->newName : $diff->name); + + foreach ($spatialIndexes as $index) { + $args + ->addSql( + $this->getIndexSql($platform, $index, $table) + ) + ; + } + } + + public function onSchemaAlterTableChangeColumn(SchemaAlterTableChangeColumnEventArgs $args): void + { + $columnDiff = $args->getColumnDiff(); + $column = $columnDiff->column; + + if (!$column->getType() instanceof PostGISType) { + return; + } + + $diff = $args->getTableDiff(); + $table = new Identifier(false !== $diff->newName ? $diff->newName : $diff->name); + + if ($columnDiff->hasChanged('type')) { + throw new RuntimeException('The type of a spatial column cannot be changed (Requested changing type from "' . ($columnDiff->fromColumn?->getType()?->getName() ?? 'N/A') . '" to "' . $column->getType()->getName() . '" for column "' . $column->getName() . '" in table "' . $table->getName() . '")'); + } + + if ($columnDiff->hasChanged('geometry_type')) { + throw new RuntimeException('The geometry_type of a spatial column cannot be changed (Requested changing type from "' . strtoupper((string) ($columnDiff->fromColumn?->getPlatformOption('geometry_type') ?? 'N/A')) . '" to "' . strtoupper((string) $column->getPlatformOption('geometry_type')) . '" for column "' . $column->getName() . '" in table "' . $table->getName() . '")'); + } + + if ($columnDiff->hasChanged('srid')) { + $args->addSql(sprintf( + "SELECT UpdateGeometrySRID('%s', '%s', %d)", + $table->getName(), + $column->getName(), + (int) $column->getPlatformOption('srid') + )); + } + } + + public function onSchemaColumnDefinition(SchemaColumnDefinitionEventArgs $args): void + { + /** @var array{type: string, default: string, field: string, isnotnull: int|bool, comment: string|null} $tableColumn */ + $tableColumn = array_change_key_case($args->getTableColumn(), CASE_LOWER); + $table = $args->getTable(); + + $schemaManager = new SchemaManager($args->getConnection(), $args->getConnection()->getDatabasePlatform()); + $info = null; + + if ('geometry' === $tableColumn['type']) { + $info = $schemaManager->getGeometrySpatialColumnInfo($table, $tableColumn['field']); + } elseif ('geography' === $tableColumn['type']) { + $info = $schemaManager->getGeographySpatialColumnInfo($table, $tableColumn['field']); + } + + if (null === $info) { + return; + } + + $default = null; + + if (isset($tableColumn['default']) + && 'NULL::geometry' !== $tableColumn['default'] + && 'NULL::geography' !== $tableColumn['default']) { + $default = $tableColumn['default']; + } + + $options = [ + 'notnull' => (bool) $tableColumn['isnotnull'], + 'default' => $default, + 'comment' => $tableColumn['comment'] ?? null, + ]; + + $column = new Column($tableColumn['field'], PostGISType::getType($tableColumn['type']), $options); + + $column + ->setPlatformOption('geometry_type', $info['type']) + ->setPlatformOption('srid', $info['srid']) + ; + + $args + ->setColumn($column) + ->preventDefault(); + } + + public function onSchemaIndexDefinition(SchemaIndexDefinitionEventArgs $args): void + { + /** @var array{name: string, columns: array, unique: bool, primary: bool, flags: array} $index */ + $index = $args->getTableIndex(); + + $schemaManager = new SchemaManager($args->getConnection(), $args->getConnection()->getDatabasePlatform()); + $spatialIndexes = $schemaManager->listSpatialIndexes($args->getTable()); + + if (!isset($spatialIndexes[$index['name']])) { + return; + } + + $spatialIndex = new Index( + $index['name'], + $index['columns'], + $index['unique'], + $index['primary'], + array_merge($index['flags'], ['spatial']) + ); + + $args + ->setIndex($spatialIndex) + ->preventDefault() + ; + } + + private function getIndexSql(AbstractPlatform $platform, Index $index, Table|Identifier $table): string + { + $name = $index->getQuotedName($platform); + $tableName = $table->getQuotedName($platform); + $columns = $index->getColumns(); + + if (0 === count($columns)) { + throw new InvalidArgumentException(sprintf( + 'Incomplete or invalid index definition %s on table %s.', + $name, + $tableName + )); + } + + if ($index->isPrimary()) { + return $platform->getCreatePrimaryKeySQL($index, $table); + } + + $query = 'CREATE INDEX ' . $name . ' ON ' . $tableName; + $query .= ' USING gist(' . implode(', ', $index->getQuotedColumns($platform)) . ')'; + + return $query; + } +} diff --git a/src/Event/ORMSchemaEventListener.php b/src/Event/ORMSchemaEventListener.php index 308031d1..1e2d1a10 100644 --- a/src/Event/ORMSchemaEventListener.php +++ b/src/Event/ORMSchemaEventListener.php @@ -4,30 +4,7 @@ namespace Jsor\Doctrine\PostGIS\Event; -use Doctrine\ORM\Tools\Event\GenerateSchemaTableEventArgs; -use Jsor\Doctrine\PostGIS\Types\PostGISType; - class ORMSchemaEventListener { - public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $args): void - { - $table = $args->getClassTable(); - - foreach ($table->getColumns() as $column) { - $type = $column->getType(); - - if (!$type instanceof PostGISType) { - continue; - } - - /** @var array{geometry_type?: string|null, srid?: int|string|null} $options */ - $options = $column->getPlatformOptions(); - - $normalized = $type->getNormalizedPostGISColumnOptions($options); - - foreach ($normalized as $name => $value) { - $column->setPlatformOption($name, $value); - } - } - } + use ORMSchemaEventSubscriberCompatibilityTrait; } diff --git a/src/Event/ORMSchemaEventSubscriber.php b/src/Event/ORMSchemaEventSubscriber.php new file mode 100644 index 00000000..6399b1ce --- /dev/null +++ b/src/Event/ORMSchemaEventSubscriber.php @@ -0,0 +1,41 @@ +getClassTable(); + + foreach ($table->getColumns() as $column) { + $type = $column->getType(); + + if (!$type instanceof PostGISType) { + continue; + } + + /** @var array{geometry_type?: string|null, srid?: int|string|null} $options */ + $options = $column->getPlatformOptions(); + + $normalized = $type->getNormalizedPostGISColumnOptions($options); + + foreach ($normalized as $name => $value) { + $column->setPlatformOption($name, $value); + } + } + } +}