From c0a309b42fc260746e8a7c3039fdce03c01b3493 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Sat, 1 Jul 2023 17:15:35 +0200 Subject: [PATCH 01/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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 \