Skip to content

Conversation

@martin-georgiev
Copy link
Owner

@martin-georgiev martin-georgiev commented Sep 1, 2025

Summary by CodeRabbit

  • Documentation
    • Expanded CONTRIBUTING with comprehensive testing patterns, tooling, Composer test scripts, environment/setup guidance, examples, and changed the recommended command to “composer run-all-tests.”
  • Refactor
    • Reorganized spatial query functions under a PostGIS-specific namespace; public class paths updated without behavior changes.
  • Tests
    • Added new integration tests for PostGIS spatial operators and updated unit/integration test namespaces/imports to match reorganization.

@coderabbitai
Copy link

coderabbitai bot commented Sep 1, 2025

Walkthrough

PostGIS-related AST function classes were moved into a new PostGIS sub-namespace, tests (unit & integration) were updated to match and several new PostGIS integration tests were added. CONTRIBUTING.md gained a large "Testing: Patterns and Guidelines" section and a command example changed from composer run-tests to composer run-all-tests.

Changes

Cohort / File(s) Summary
Docs: Testing guidelines
docs/CONTRIBUTING.md
Replace composer run-tests with composer run-all-tests; add a comprehensive "Testing: Patterns and Guidelines" section covering tooling, Composer scripts, unit vs integration guidance, environment/setup, examples, fixtures, coverage paths, base test utilities, exception conventions, and style.
Source: PostGIS namespace relocation
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/* (e.g., \.../PostGIS/BoundingBoxDistance.php, GeometryDistance.php, NDimensional*, Overlaps*.php, Spatial*.php, Strictly*.php, TrajectoryDistance.php)
Move many AST function classes from MartinGeorgiev\Doctrine\ORM\Query\AST\Functions into MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS; add use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction; imports in multiple files. No functional logic changes shown.
Integration tests: namespace realignment
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/* (many files)
Update integration test namespaces and imports from ...Functions...Functions\PostGIS to align with source relocations.
Integration tests: new
tests/Integration/.../Functions/PostGIS/SpatialContainedByTest.php, .../SpatialContainsTest.php, .../SpatialSameTest.php, .../StrictlyRightTest.php
Add new integration tests that register PostGIS DQL functions and assert boolean outcomes against geometry fixtures (three test cases each, using SpatialOperatorTestCase).
Unit tests: namespace realignment + imports
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/* (many files)
Move unit tests into ...Functions\PostGIS; update imports to PostGIS class paths; add use Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase; in many tests; remove some unused fixture imports.
DBAL tests: import update
tests/Integration/.../DBAL/Types/RangeTypeTestCase.php
Update registration/import to reference ...Functions\PostGIS\Overlaps instead of ...Functions\Overlaps.

Sequence Diagram(s)

(omitted — changes are namespace/test reorganizations and documentation additions; no new runtime control flow to diagram)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

I hopped through namespaces, light and spry,
PostGIS burrows neatly stacked up high.
Tests now check the shapes I trace,
Names aligned in tidy space.
Thump-thump! I celebrate with a carrot-sized high-five 🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch postgis-functions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalCentroidDistanceTest.php (1)

5-16: Fix import to PostGIS namespace

The class was moved under the PostGIS sub-namespace; update the import accordingly to prevent autoloading failures.

Apply this diff:

-use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\NDimensionalCentroidDistance;
+use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\NDimensionalCentroidDistance;
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsRightTest.php (1)

5-16: Update import to PostGIS namespace

The implementation class moved; the test should import the PostGIS-qualified class.

Apply this diff:

-use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\OverlapsRight;
+use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\OverlapsRight;
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/TrajectoryDistanceTest.php (1)

5-16: Update import to PostGIS namespace

Adjust the import to the relocated TrajectoryDistance class to avoid failures.

Apply this diff:

-use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TrajectoryDistance;
+use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\TrajectoryDistance;
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyAboveTest.php (1)

10-17: Fix imports in PostGIS integration tests
In every file under tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS, replace imports from the base namespace with the PostGIS subnamespace.
For example, in StrictlyAboveTest.php (line 7):

- use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\StrictlyAbove;
+ use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\StrictlyAbove;

Apply the same change for TrajectoryDistanceTest, StrictlyRightTest, StrictlyLeftTest, StrictlyBelowTest, SpatialSameTest, SpatialContainsTest, SpatialContainedByTest, Overlaps*Test, NDimensionalOverlapsTest, NDimensionalCentroidDistanceTest, GeometryDistanceTest, BoundingBoxDistanceTest, etc.

tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/GeometryDistanceTest.php (1)

5-16: Update imports in PostGIS integration tests
In tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/*Test.php, change

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\FunctionName;

to

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\FunctionName;

Example (GeometryDistanceTest):

-use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\GeometryDistance;
+use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\GeometryDistance;
🧹 Nitpick comments (20)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/Overlaps.php (1)

9-19: Clarify docs: && applies to arrays and PostGIS; add PostGIS reference.

Doc still links only to array functions and can confuse under PostGIS namespace. Suggest updating wording and references.

- * Implementation of PostgreSQL check if left side overlaps with right side (using &&).
+ * Implementation of the overlaps operator (&&) for arrays and PostGIS geometry bounding boxes.
@@
- * @see https://www.postgresql.org/docs/9.6/static/functions-array.html
+ * @see https://www.postgresql.org/docs/current/functions-array.html
+ * @see https://postgis.net/docs/reference.html#Operators_Geometry
@@
- * @example Using it in DQL with boolean comparison: "WHERE OVERLAPS(e.textArray, e.integerArray) = TRUE"
- * Returns boolean, must be used with "= TRUE" or "= FALSE" in DQL.
+ * @example Arrays:   WHERE OVERLAPS(e.textArray, e.integerArray) = TRUE
+ * @example Geometry: WHERE OVERLAPS(g1.geometry, g2.geometry) = TRUE
+ * Returns boolean, must be used with "= TRUE" or "= FALSE" in DQL.
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsTest.php (1)

5-11: Unit test namespace/imports updated correctly.

Note: test mixes array and PostGIS use-cases under a PostGIS test namespace; acceptable, but could be clearer if arrays assertions lived in a non-PostGIS test or the doc clarified dual purpose.

docs/CONTRIBUTING.md (3)

274-281: Prefer modern Docker Compose syntax.

-  - Start: `docker-compose up -d`
-  - Stop: `docker-compose down -v`
+  - Start: `docker compose up -d`
+  - Stop: `docker compose down -v`

328-331: Clarify where PostGIS is enabled to match project practice.

-    - Sets up Doctrine ORM config, connection, schema `test`, caches, and ensures PostGIS
+    - Sets up Doctrine ORM config, connection, schema `test`, caches, and ensures PostGIS
+      (PostGIS extension is created in `createTestSchema()` of the base `TestCase`)

268-273: Nice section. Small formatting tweak for readability.

-Composer scripts:
+Composer scripts:

(no content change; consider converting this list to a code block in a later edit if the bullets grow further)

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsLeft.php (1)

15-16: Confirm @SInCE tag accuracy after move

Since this is a namespace relocation, ensure the @SInCE value reflects the version the operator was originally introduced, not the refactor version.

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsAbove.php (1)

5-8: Consider a BC alias for the old FQCN.

Moving classes is a breaking change. Optionally add class_alias stubs (or a transitional polyfill file) from the old namespace to the new to ease upgrades until the next major.

tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyLeftTest.php (1)

20-33: Add a literal-on-the-left coverage case.

Catches parsing of StringPrimary first arg and symmetry of operator usage.

Apply:

     protected function getExpectedSqlStatements(): array
     {
         return [
             'checks if geometry is strictly to the left' => 'SELECT (c0_.geometry1 << c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
             'checks if geometry is strictly to the left of literal' => "SELECT (c0_.geometry1 << 'POINT(1 2)') AS sclr_0 FROM ContainsGeometries c0_",
+            'checks if literal is strictly to the left of geometry' => "SELECT ('POINT(-1 2)' << c0_.geometry1) AS sclr_0 FROM ContainsGeometries c0_",
         ];
     }
@@
     protected function getDqlStatements(): array
     {
         return [
             'checks if geometry is strictly to the left' => \sprintf('SELECT STRICTLY_LEFT(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
             'checks if geometry is strictly to the left of literal' => \sprintf("SELECT STRICTLY_LEFT(e.geometry1, 'POINT(1 2)') FROM %s e", ContainsGeometries::class),
+            'checks if literal is strictly to the left of geometry' => \sprintf("SELECT STRICTLY_LEFT('POINT(-1 2)', e.geometry1) FROM %s e", ContainsGeometries::class),
         ];
     }
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalBoundingBoxDistance.php (1)

25-31: Operator token and version support.

'<<#>>' is the n-D bbox distance operator; confirm CI PostGIS version supports it and consider noting minimum version in the docblock.

src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainedBy.php (1)

9-22: Clarify boolean usage in example.

To mirror other operators, add an example in SELECT context and one in WHERE with explicit = TRUE for older Doctrine setups.

Apply:

- * @example Using it in DQL with boolean comparison: "WHERE SPATIAL_CONTAINED_BY(g1.geometry, g2.geometry) = TRUE"
- * Returns boolean, must be used with "= TRUE" or "= FALSE" in DQL.
+ * @example SELECT: "SELECT SPATIAL_CONTAINED_BY(g1.geometry, g2.geometry) FROM Entity g1, Entity g2"
+ * @example WHERE (for older Doctrine): "WHERE SPATIAL_CONTAINED_BY(g1.geometry, g2.geometry) = TRUE"
+ * Returns boolean.
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsAboveTest.php (1)

20-32: Add WKT literal coverage for second arg symmetry.

Mirrors StrictlyLeft test style and guards StringPrimary parsing.

Apply:

     protected function getExpectedSqlStatements(): array
     {
         return [
             'checks if geometry overlaps or is above' => 'SELECT (c0_.geometry1 |&> c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
+            'checks if geometry overlaps or is above literal' => "SELECT (c0_.geometry1 |&> 'LINESTRING(0 0,1 1)') AS sclr_0 FROM ContainsGeometries c0_",
         ];
     }
@@
     protected function getDqlStatements(): array
     {
         return [
             'checks if geometry overlaps or is above' => \sprintf('SELECT OVERLAPS_ABOVE(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
+            'checks if geometry overlaps or is above literal' => \sprintf("SELECT OVERLAPS_ABOVE(e.geometry1, 'LINESTRING(0 0,1 1)') FROM %s e", ContainsGeometries::class),
         ];
     }
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyBelow.php (1)

5-8: Confirm BC strategy for moved FQCNs

Moving classes to PostGIS breaks users’ StringFunctions mappings that reference old FQCNs. If this is not a major release, consider temporary shims (old classes extending new ones) or class_alias loaded via a compat file.

Example shim (new file at old path):

<?php
declare(strict_types=1);

namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;

class StrictlyBelow extends \MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\StrictlyBelow {}
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialSameTest.php (1)

20-31: Optional: add a literal-WKT case for parity with other operators.

Consider mirroring OverlapsLeftTest by adding a second assertion using a WKT literal on one side to lock in quoting and SQL shape.

         return [
             'checks if geometries have same bounding box' => 'SELECT (c0_.geometry1 ~= c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
+            'checks if geometry has same bbox as literal' => "SELECT (c0_.geometry1 ~= 'POINT(1 2)') AS sclr_0 FROM ContainsGeometries c0_",
         ];
         return [
             'checks if geometries have same bounding box' => \sprintf('SELECT SPATIAL_SAME(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
+            'checks if geometry has same bbox as literal' => \sprintf("SELECT SPATIAL_SAME(e.geometry1, 'POINT(1 2)') FROM %s e", ContainsGeometries::class),
         ];
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsBelowTest.php (1)

20-31: Optional: add a literal-WKT variant for symmetry.

Match OverlapsLeftTest by adding a literal case to increase coverage and consistency.

         return [
             'checks if geometry overlaps or is below' => 'SELECT (c0_.geometry1 &<| c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
+            'checks if geometry overlaps or is below literal' => "SELECT (c0_.geometry1 &<| 'POINT(1 2)') AS sclr_0 FROM ContainsGeometries c0_",
         ];
         return [
             'checks if geometry overlaps or is below' => \sprintf('SELECT OVERLAPS_BELOW(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
+            'checks if geometry overlaps or is below literal' => \sprintf("SELECT OVERLAPS_BELOW(e.geometry1, 'POINT(1 2)') FROM %s e", ContainsGeometries::class),
         ];
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalCentroidDistanceTest.php (1)

20-31: Optional: add a literal-WKT assertion.

A second case with a WKT literal would mirror the pattern used in other operators.

         return [
             'calculates n-dimensional centroid distance' => 'SELECT (c0_.geometry1 <<->> c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
+            'calculates n-D centroid distance to literal' => "SELECT (c0_.geometry1 <<->> 'POINT(1 2)') AS sclr_0 FROM ContainsGeometries c0_",
         ];
         return [
             'calculates n-dimensional centroid distance' => \sprintf('SELECT ND_CENTROID_DISTANCE(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
+            'calculates n-D centroid distance to literal' => \sprintf("SELECT ND_CENTROID_DISTANCE(e.geometry1, 'POINT(1 2)') FROM %s e", ContainsGeometries::class),
         ];
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialSameTest.php (1)

5-17: Restrict import-namespace scan to PostGIS tests
Narrow the rg command to only the PostGIS directory to avoid false positives. For example:

rg -nP '^use\s+MartinGeorgiev\\Doctrine\\ORM\\Query\\AST\\Functions\\(?!PostGIS\\)' tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS -g '!**/vendor/**'
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php (1)

42-42: Fix typos in test name

Clean up the method name for readability in test output.

-    public function returns_true_when_higher_linestring_is_strictly_to_the_right_of_lower_onetrajetoryds(): void
+    public function returns_true_when_upper_linestring_is_strictly_to_the_right_of_the_lower_one(): void
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalBoundingBoxDistanceTest.php (1)

20-32: Add a literal-operand case for parity with other spatial tests

Consider also asserting SQL generation when the right operand is a WKT literal (e.g., 'POINT(1 2)') to mirror GeometryDistance/SpatialContains coverage.

     protected function getExpectedSqlStatements(): array
     {
         return [
             'calculates n-dimensional bounding box distance' => 'SELECT (c0_.geometry1 <<#>> c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
+            'calculates n-dimensional bounding box distance to literal' => "SELECT (c0_.geometry1 <<#>> 'POINT(1 2)') AS sclr_0 FROM ContainsGeometries c0_",
         ];
     }

     protected function getDqlStatements(): array
     {
         return [
             'calculates n-dimensional bounding box distance' => \sprintf('SELECT ND_BOUNDING_BOX_DISTANCE(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
+            'calculates n-dimensional bounding box distance to literal' => \sprintf("SELECT ND_BOUNDING_BOX_DISTANCE(e.geometry1, 'POINT(1 2)') FROM %s e", ContainsGeometries::class),
         ];
     }
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainsTest.php (1)

20-34: Consider covering literal-on-the-left operand as well

Operator ~ should accept a WKT literal on the left; add symmetry coverage.

     protected function getExpectedSqlStatements(): array
     {
         return [
             'checks if geometry spatially contains another' => 'SELECT (c0_.geometry1 ~ c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
             'checks if geometry spatially contains literal' => "SELECT (c0_.geometry1 ~ 'POINT(1 2)') AS sclr_0 FROM ContainsGeometries c0_",
+            'checks if literal spatially contains geometry' => "SELECT ('POINT(1 2)' ~ c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_",
         ];
     }

     protected function getDqlStatements(): array
     {
         return [
             'checks if geometry spatially contains another' => \sprintf('SELECT SPATIAL_CONTAINS(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
             'checks if geometry spatially contains literal' => \sprintf("SELECT SPATIAL_CONTAINS(e.geometry1, 'POINT(1 2)') FROM %s e", ContainsGeometries::class),
+            'checks if literal spatially contains geometry' => \sprintf("SELECT SPATIAL_CONTAINS('POINT(1 2)', e.geometry2) FROM %s e", ContainsGeometries::class),
         ];
     }
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/GeometryDistanceTest.php (1)

20-34: Add symmetry case with literal on the left

Distance operator <-> is symmetric; include left-literal coverage for consistency.

     protected function getExpectedSqlStatements(): array
     {
         return [
             'calculates distance between geometries' => 'SELECT (c0_.geometry1 <-> c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_',
             'calculates distance between geometry and literal' => "SELECT (c0_.geometry1 <-> 'POINT(1 2)') AS sclr_0 FROM ContainsGeometries c0_",
+            'calculates distance between literal and geometry' => "SELECT ('POINT(1 2)' <-> c0_.geometry2) AS sclr_0 FROM ContainsGeometries c0_",
         ];
     }

     protected function getDqlStatements(): array
     {
         return [
             'calculates distance between geometries' => \sprintf('SELECT GEOMETRY_DISTANCE(e.geometry1, e.geometry2) FROM %s e', ContainsGeometries::class),
             'calculates distance between geometry and literal' => \sprintf("SELECT GEOMETRY_DISTANCE(e.geometry1, 'POINT(1 2)') FROM %s e", ContainsGeometries::class),
+            'calculates distance between literal and geometry' => \sprintf("SELECT GEOMETRY_DISTANCE('POINT(1 2)', e.geometry2) FROM %s e", ContainsGeometries::class),
         ];
     }

Comment on lines +5 to +7
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS;

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Guard against stale imports to pre-PostGIS namespace.

Quick scan to ensure no remaining use ...\Functions\SpatialContains (without PostGIS) across src/tests.


🏁 Script executed:

#!/bin/bash
# Find usages of moved classes that still import from the old namespace (missing \PostGIS\).
rg -nP --type=php $'use\\s+MartinGeorgiev\\\\Doctrine\\\\ORM\\\\Query\\\\AST\\\\Functions\\\\(?!PostGIS\\\\)(SpatialContains|SpatialContainedBy|SpatialSame|Strictly(Above|Below|Left|Right)|Overlaps(Left|Right|Above|Below)?|BoundingBoxDistance|GeometryDistance|TrajectoryDistance|NDimensional(Overlaps|BoundingBoxDistance|CentroidDistance))\\b' -C2

Length of output: 14789


🏁 Script executed:

#!/usr/bin/env bash
# Locate the RangeTypeTestCase file and display its imports
target=$(fd RangeTypeTestCase.php)
echo "Inspecting: $target"
sed -n '1,50p' "$target"

Length of output: 2058


Update test imports to new PostGIS namespace
Integration tests under tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions (both the root folder and its PostGIS subdirectory) still import spatial functions from the old namespace. Replace every

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\<FunctionName>;

with

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\<FunctionName>;

for all spatial operators (TrajectoryDistance, Strictly*, Overlaps*, Spatial*, NDimensional*, GeometryDistance, BoundingBoxDistance).

🤖 Prompt for AI Agents
In
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContains.php
around lines 5 to 7, the integration tests still import spatial functions from
the old namespace; update all test files under
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions and its
PostGIS subdirectory to replace any line like "use
MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\<FunctionName>;" with "use
MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\<FunctionName>;" for all
spatial operators (TrajectoryDistance, Strictly*, Overlaps*, Spatial*,
NDimensional*, GeometryDistance, BoundingBoxDistance); perform a project-wide
search-and-replace on those use statements, ensure PHP namespaces are valid and
imports updated, then run the test suite to confirm no remaining stale imports.

Comment on lines 5 to 8
namespace Tests\Integration\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS;

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BoundingBoxDistance;
use PHPUnit\Framework\Attributes\Test;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Fix import to new PostGIS namespace

The function classes were moved; this test still imports the old namespace. Update to avoid class-not-found during registration.

Apply:

-use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BoundingBoxDistance;
+use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\BoundingBoxDistance;

Run to catch any remaining non-PostGIS imports under PostGIS test folders:


🏁 Script executed:

#!/bin/bash
rg -nP "(?<=use\s)MartinGeorgiev\\\\Doctrine\\\\ORM\\\\Query\\\\AST\\\\Functions\\\\(?!PostGIS\\\\)" \
  tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS \
  tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS -S -C0

Length of output: 2954


Fix PostGIS function imports in integration tests
All test classes under tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS still import functions from the root namespace. Update each import on line 7 in these files to include the PostGIS segment in the namespace:

Affected files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/BoundingBoxDistanceTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyBelowTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyAboveTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/TrajectoryDistanceTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyLeftTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainsTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialSameTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainedByTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsLeftTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsRightTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsBelowTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsAboveTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalOverlapsTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/GeometryDistanceTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalCentroidDistanceTest.php

Example diff for any file:

-use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\FunctionName;
+use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\FunctionName;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
namespace Tests\Integration\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BoundingBoxDistance;
use PHPUnit\Framework\Attributes\Test;
namespace Tests\Integration\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS;
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\BoundingBoxDistance;
use PHPUnit\Framework\Attributes\Test;
🤖 Prompt for AI Agents
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/BoundingBoxDistanceTest.php
lines 5-8: the test imports the function from the root Functions namespace;
change the import on line 7 to include the PostGIS segment (e.g. use
MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\BoundingBoxDistance;)
and apply the same update to the equivalent import line in each of the other
files listed in the comment so all PostGIS function imports reference the
PostGIS subnamespace.

declare(strict_types=1);

namespace Tests\Integration\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;
namespace Tests\Integration\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Scan for other outdated imports in PostGIS tests

There may be similar imports left behind in other PostGIS tests. Run this to verify and fix any remaining occurrences.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Expect: no matches. Any output indicates an import that must be changed to Functions\PostGIS\...
rg -nP --glob 'tests/**/Functions/PostGIS/**.php' $'^\s*use\s+MartinGeorgiev\\Doctrine\\ORM\\Query\\AST\\Functions\\(?!PostGIS\\)'

Length of output: 222


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Scan for any non-PostGIS imports in PostGIS test files.
# Expect no output; any lines printed indicate outdated imports to update.
rg -n --glob 'tests/**/Functions/PostGIS/**/*.php' -e 'use MartinGeorgiev\\Doctrine\\ORM\\Query\\AST\\Functions\\' \
  | rg -v -e 'PostGIS\\'

Length of output: 2877


Update import namespaces in PostGIS integration tests
In every file under tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/*.php, change the import on line 7 from

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\<FunctionName>;

to

use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\<FunctionName>;

so they match the PostGIS subnamespace.

🤖 Prompt for AI Agents
In
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalCentroidDistanceTest.php
around line 5 (and specifically update the import on line 7), the current import
uses the parent namespace
MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\<FunctionName>; update that
import to the PostGIS subnamespace
MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\<FunctionName> so the
test imports the correct class in the PostGIS folder.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php (4)

22-24: Avoid hard-coding the entity FQCN in DQL; import and use ::class

This improves refactor-safety and readability.

Apply:

 use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\StrictlyRight;
+use Fixtures\MartinGeorgiev\Doctrine\Entity\ContainsGeometries;
 use PHPUnit\Framework\Attributes\Test;
-        $dql = 'SELECT STRICTLY_RIGHT(g.geometry1, g.geometry2) as result
-                FROM Fixtures\MartinGeorgiev\Doctrine\Entity\ContainsGeometries g
-                WHERE g.id = 1';
+        $dql = 'SELECT STRICTLY_RIGHT(g.geometry1, g.geometry2) as result
+                FROM ' . ContainsGeometries::class . ' g
+                WHERE g.id = 1';
-        $dql = "SELECT STRICTLY_RIGHT(g.geometry1, 'POINT(-5 -5)') as result
-                FROM Fixtures\MartinGeorgiev\Doctrine\Entity\ContainsGeometries g
-                WHERE g.id = 1";
+        $dql = "SELECT STRICTLY_RIGHT(g.geometry1, 'POINT(-5 -5)') as result
+                FROM " . ContainsGeometries::class . " g
+                WHERE g.id = 1";
-        $dql = 'SELECT STRICTLY_RIGHT(g.geometry2, g.geometry1) as result
-                FROM Fixtures\MartinGeorgiev\Doctrine\Entity\ContainsGeometries g
-                WHERE g.id = 3';
+        $dql = 'SELECT STRICTLY_RIGHT(g.geometry2, g.geometry1) as result
+                FROM ' . ContainsGeometries::class . ' g
+                WHERE g.id = 3';

Also applies to: 33-35, 45-46, 7-9


26-28: Add a quick guard on result size before indexing

Prevents undefined index if the query unexpectedly returns 0 rows (helps triage failures).

         $result = $this->executeDqlQuery($dql);
+        $this->assertCount(1, $result);
         $this->assertFalse($result[0]['result']);
         $result = $this->executeDqlQuery($dql);
+        $this->assertCount(1, $result);
         $this->assertTrue($result[0]['result']);
         $result = $this->executeDqlQuery($dql);
+        $this->assertCount(1, $result);
         $this->assertTrue($result[0]['result']);

Also applies to: 37-39, 48-50


41-43: Fix typo in test name

“onetrajetoryds” looks like a typo; suggest a clearer name.

-    public function returns_true_when_higher_linestring_is_strictly_to_the_right_of_lower_onetrajetoryds(): void
+    public function returns_true_when_higher_linestring_is_strictly_to_the_right_of_lower_linestring(): void

31-35: Optional: Add a parameterized variant

Consider an extra case using a bound parameter for the WKT (e.g., :wkt) to verify parameter binding with spatial operators, not only string literals.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8671fb3 and 6fdc079.

📒 Files selected for processing (16)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/BoundingBoxDistanceTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/GeometryDistanceTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalCentroidDistanceTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalOverlapsTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsAboveTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsBelowTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsLeftTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsRightTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainedByTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainsTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialSameTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyAboveTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyBelowTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyLeftTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php (1 hunks)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/TrajectoryDistanceTest.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (15)
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyAboveTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyBelowTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/TrajectoryDistanceTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainsTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalCentroidDistanceTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/NDimensionalOverlapsTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsAboveTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialSameTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/GeometryDistanceTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyLeftTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/BoundingBoxDistanceTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsBelowTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsLeftTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/OverlapsRightTest.php
  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialContainedByTest.php
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#0
File: :0-0
Timestamp: 2025-08-24T16:52:32.488Z
Learning: All new features in this repository must include proper test coverage before approval - this ltree implementation demonstrates exemplary test coverage with comprehensive unit tests, integration tests, data providers for edge cases, and validation of all relationships and error conditions.
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#0
File: :0-0
Timestamp: 2025-08-25T21:35:48.228Z
Learning: Extensions in integration tests should be created in the createTestSchema() method of the base TestCase, following the established PostGIS pattern with proper error handling, not in individual test createXExtension() methods.
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#357
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RegexpMatchTest.php:28-62
Timestamp: 2025-04-22T00:03:37.733Z
Learning: This project focuses on providing Doctrine ORM interfaces to PostgreSQL functions. Tests should validate correct DQL-to-SQL translation rather than PostgreSQL functionality itself. Test cases should focus on parameter passing and SQL generation, not on testing specific PostgreSQL regex pattern behaviors.
📚 Learning: 2025-08-27T18:19:35.778Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#430
File: tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/StrictlyRightTest.php:31-36
Timestamp: 2025-08-27T18:19:35.778Z
Learning: WKT string literals can be used directly in Doctrine spatial function tests (e.g., 'POINT(-5 -5)') without explicit ST_GeomFromText wrapping, as PostgreSQL/PostGIS automatically handles the implicit conversion to geometry types when used with spatial operators.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
📚 Learning: 2025-05-23T11:11:57.951Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#383
File: tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.php:1-9
Timestamp: 2025-05-23T11:11:57.951Z
Learning: Tests in the `Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), rather than PHPUnit's TestCase directly, and therefore don't need an explicit import.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
📚 Learning: 2025-03-29T03:31:17.114Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#318
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/XmlAggTest.php:1-9
Timestamp: 2025-03-29T03:31:17.114Z
Learning: Tests in the `Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), rather than PHPUnit's TestCase, and therefore don't need an explicit import.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
📚 Learning: 2025-03-29T03:31:17.114Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#318
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/XmlAggTest.php:1-9
Timestamp: 2025-03-29T03:31:17.114Z
Learning: Tests in the `Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), not PHPUnit's TestCase, and therefore don't need an explicit import statement.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
📚 Learning: 2025-04-22T00:03:37.733Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#357
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RegexpMatchTest.php:28-62
Timestamp: 2025-04-22T00:03:37.733Z
Learning: This project focuses on providing Doctrine ORM interfaces to PostgreSQL functions. Tests should validate correct DQL-to-SQL translation rather than PostgreSQL functionality itself. Test cases should focus on parameter passing and SQL generation, not on testing specific PostgreSQL regex pattern behaviors.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
📚 Learning: 2025-08-19T13:07:15.184Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#421
File: docs/AVAILABLE-TYPES.md:31-33
Timestamp: 2025-08-19T13:07:15.184Z
Learning: In martin-georgiev/postgresql-for-doctrine, the point[] array type should be documented as "point[]" not "_point" in the AVAILABLE-TYPES.md table, to be consistent with all other array types like text[], jsonb[], inet[], etc.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
📚 Learning: 2025-03-11T17:02:51.971Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#0
File: :0-0
Timestamp: 2025-03-11T17:02:51.971Z
Learning: When using operator-like functions in PostgreSQL-for-doctrine, they must be used as boolean functions with `= TRUE` rather than as direct operators (e.g., `RIGHT_EXISTS_ON_LEFT(column, value) = TRUE` instead of `column RIGHT_EXISTS_ON_LEFT value`).

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php
🧬 Code graph analysis (1)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php (4)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRight.php (1)
  • StrictlyRight (22-30)
tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php (1)
  • StrictlyRightTest (11-33)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/SpatialOperatorTestCase.php (1)
  • SpatialOperatorTestCase (9-80)
tests/Integration/MartinGeorgiev/TestCase.php (1)
  • executeDqlQuery (271-285)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.4
  • GitHub Check: PostgreSQL 16 + PostGIS 3.5 + PHP 8.4
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.3
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.4
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.3
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.4
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.3
  • GitHub Check: PostgreSQL 16 + PostGIS 3.5 + PHP 8.3
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.1
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.2
  • GitHub Check: PostgreSQL 16 + PostGIS 3.5 + PHP 8.2
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.1
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.2
  • GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest
  • GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0
  • GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest
  • GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest
  • GitHub Check: wait-for-tests-worflows-before-upload
🔇 Additional comments (3)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/StrictlyRightTest.php (3)

7-7: LGTM: correct PostGIS namespaced import

The import points to the new PostGIS sub-namespace as intended by the refactor.


12-17: Function registration aligns with the refactor

Maps STRICTLY_RIGHT to the relocated class; looks good.


30-39: LGTM: direct WKT literal usage

Using a WKT string literal with the spatial operator is correct here and consistent with prior learnings for integration tests.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php (1)

10-10: Avoid coupling range tests to PostGIS namespace; use core Overlaps instead

The && overlaps operator for ranges is a core PostgreSQL feature, not PostGIS-specific. Importing PostGIS\Overlaps here conflates concerns and may mislead users of range types that don’t require PostGIS. If a generic Functions\Overlaps still exists, prefer it. If it was moved, consider re-introducing a core Overlaps (and have PostGIS\Overlaps extend/alias it) to keep namespaces semantically accurate.

Apply if the generic class is available:

-use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS\Overlaps;
+use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Overlaps;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6fdc079 and d481ad8.

📒 Files selected for processing (1)
  • tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#0
File: :0-0
Timestamp: 2025-08-24T16:52:32.488Z
Learning: All new features in this repository must include proper test coverage before approval - this ltree implementation demonstrates exemplary test coverage with comprehensive unit tests, integration tests, data providers for edge cases, and validation of all relationships and error conditions.
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#0
File: :0-0
Timestamp: 2025-08-25T21:35:48.228Z
Learning: Extensions in integration tests should be created in the createTestSchema() method of the base TestCase, following the established PostGIS pattern with proper error handling, not in individual test createXExtension() methods.
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#357
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RegexpMatchTest.php:28-62
Timestamp: 2025-04-22T00:03:37.733Z
Learning: This project focuses on providing Doctrine ORM interfaces to PostgreSQL functions. Tests should validate correct DQL-to-SQL translation rather than PostgreSQL functionality itself. Test cases should focus on parameter passing and SQL generation, not on testing specific PostgreSQL regex pattern behaviors.
📚 Learning: 2025-03-11T12:32:10.726Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#263
File: src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Numrange.php:19-21
Timestamp: 2025-03-11T12:32:10.726Z
Learning: In the postgresql-for-doctrine repository, PostgreSQL range functions have distinct implementations for different data types. The `Numrange` function works with numeric/decimal values and is tested using the `ContainsDecimals` fixture with properties typed as `float`. In contrast, the `Int4range` function works with 32-bit integers and is tested using the `ContainsIntegers` fixture with properties typed as `int`. While the PHP implementations share a similar structure (extending `BaseFunction`), they are semantically different as they handle different PostgreSQL data types.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php
📚 Learning: 2025-03-29T03:31:17.114Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#318
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/XmlAggTest.php:1-9
Timestamp: 2025-03-29T03:31:17.114Z
Learning: Tests in the `Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), rather than PHPUnit's TestCase, and therefore don't need an explicit import.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php
📚 Learning: 2025-05-23T11:11:57.951Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#383
File: tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.php:1-9
Timestamp: 2025-05-23T11:11:57.951Z
Learning: Tests in the `Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), rather than PHPUnit's TestCase directly, and therefore don't need an explicit import.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php
📚 Learning: 2025-03-29T03:31:17.114Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#318
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/XmlAggTest.php:1-9
Timestamp: 2025-03-29T03:31:17.114Z
Learning: Tests in the `Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), not PHPUnit's TestCase, and therefore don't need an explicit import statement.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php
📚 Learning: 2025-08-24T23:39:18.782Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#411
File: src/MartinGeorgiev/Doctrine/DBAL/Types/ValueObject/LtreeInterface.php:7-7
Timestamp: 2025-08-24T23:39:18.782Z
Learning: This repository follows a concrete value object pattern without interfaces. All value objects (Point, DateRange, Int4Range, NumericRange, etc.) are concrete classes that directly implement required interfaces like \Stringable and \JsonSerializable. The codebase uses abstract base classes for shared functionality rather than interfaces for abstraction. Adding interfaces for value objects violates the established architectural patterns.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php
📚 Learning: 2025-04-11T11:23:44.192Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#340
File: tests/MartinGeorgiev/Doctrine/DBAL/Types/InetArrayTest.php:145-145
Timestamp: 2025-04-11T11:23:44.192Z
Learning: In the PostgreSQL for Doctrine test cases, methods that test database-to-PHP conversions should use `mixed` type for parameter and include non-string test cases in their data providers, following the pattern in classes like InetTest, CidrTest, and MacaddrTest.

Applied to files:

  • tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php
🧬 Code graph analysis (1)
tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/RangeTypeTestCase.php (1)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/Overlaps.php (1)
  • Overlaps (20-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2
  • GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest
  • GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest
  • GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest
  • GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0
  • GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest
  • GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest
  • GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest
  • GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest
  • GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1
  • GitHub Check: PostgreSQL 16 + PostGIS 3.5 + PHP 8.4
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.4
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.3
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.3
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.1
  • GitHub Check: sloth
  • GitHub Check: wait-for-tests-worflows-before-upload

@martin-georgiev martin-georgiev marked this pull request as ready for review September 1, 2025 11:10
@martin-georgiev martin-georgiev merged commit 522e653 into main Sep 1, 2025
67 of 68 checks passed
@martin-georgiev martin-georgiev deleted the postgis-functions branch September 1, 2025 11:10
@github-actions github-actions bot mentioned this pull request Aug 27, 2025
@coveralls
Copy link

Coverage Status

coverage: 94.55%. remained the same
when pulling d481ad8 on postgis-functions
into 5b5583b on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants