Skip to content

Conversation

@martin-georgiev
Copy link
Owner

@martin-georgiev martin-georgiev commented Oct 23, 2025

Summary by CodeRabbit

  • Tests

    • Added PHP 8.5 to integration and unit test workflows.
    • Minor test change: one test no longer explicitly destroys an image resource.
  • Chores

    • Adjusted PHP compatibility to allow PHP >=8.1 and <8.6.
    • Raised suggested PHP version to 8.4.
  • Documentation

    • Updated contribution docs to reference PHP 8.5 and fixed hyphenation.
  • Refactor

    • Small internal cleanups to integer validation and array/value callbacks to reduce duplication.

@coderabbitai
Copy link

coderabbitai bot commented Oct 23, 2025

Warning

Rate limit exceeded

@martin-georgiev has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between ca59157 and a2edf8b.

📒 Files selected for processing (2)
  • .github/workflows/integration-tests.yml (4 hunks)
  • .github/workflows/unit-tests.yml (2 hunks)

Walkthrough

Adds PHP 8.5 to CI matrices and PHP setup steps, tightens composer PHP constraint to <8.6, adjusts php-cs-fixer rule key, small code cleanups (introduces integer-fit helper, switches callable shorthand in two places, tweaks WKT trimming), updates docs phrasing, and removes a test-side resource cleanup.

Changes

Cohort / File(s) Summary
CI workflows
.github/workflows/integration-tests.yml, .github/workflows/unit-tests.yml, .github/workflows/ci.yml
Add PHP 8.5 to GitHub Actions PHP matrices and change PHP setup targets from 8.4→8.5; update code-coverage/include entries to reference 8.5.
Composer manifest
composer.json
Constrain PHP platform to ^8.1 <8.6 (restricts to before 8.6) and bump suggested PHP from ^8.3^8.4.
Code — integer validation helper
src/MartinGeorgiev/Doctrine/DBAL/Types/BaseIntegerArray.php
Introduce private function fitsInPHPInteger(string $value): bool and replace inline int-fit checks with the helper in two locations.
Code — callable shorthand changes
src/MartinGeorgiev/Doctrine/DBAL/Types/SpatialDataArray.php, src/MartinGeorgiev/Utils/PHPArrayToPostgresValueTransformer.php
Replace string-callable forms ('trim', 'is_array') with argument-unpacking callables (trim(...), is_array(...)) in array_map/array_filter callbacks.
Tests
tests/Unit/MartinGeorgiev/Utils/PHPArrayToPostgresValueTransformerTest.php
Remove explicit imagedestroy call in can_transform_array_with_gd_resource test (test no longer destroys the GD resource).
Code style config
ci/php-cs-fixer/config.php
Replace rule key @PHP71Migration with @PHP7x1Migration in the PhpCsFixer rules map.
Docs
docs/CONTRIBUTING.md
Update example Nix snippet to PHP 8.5 and change wording from "PostgreSQL related" → "PostgreSQL-related".

Sequence Diagram(s)

sequenceDiagram
  participant Caller as Validator / Transformer
  participant Base as BaseIntegerArray
  rect #e8f6ff
    Caller->>Base: provide string value (e.g., "12345678901234567890")
    Base->>Base: fitsInPHPInteger(string)
    alt FILTER_VALIDATE_INT returns int
      Base-->>Caller: treat as PHP-int-compatible (continue)
    else not PHP-int
      Base-->>Caller: throw OutOfBounds/Type exception or continue to min/max checks
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰
Hopping through CI, I sniff PHP eight-point-five,
Rules and callables tidied so our code can thrive.
A helper checks integers, trims WKT with care,
Composer pins the range — the burrow's nearly bare.
I nibble docs and tests, then bound back to my hive. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "chore: run the project on PHP 8.5" is clearly related to the primary changes in the changeset. The majority of modifications directly support PHP 8.5 compatibility, including updates to GitHub Actions workflows to include PHP 8.5 in the test matrix, updates to composer.json constraints and suggestions, and documentation updates reflecting PHP 8.5. The code-level changes (callback syntax modifications using first-class callable syntax, helper method refactoring, and test cleanup) appear consistent with PHP 8.5 compatibility work. The title concisely and clearly summarizes the main objective without being vague, misleading, or excessively broad.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 23, 2025
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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5545de and ca59157.

📒 Files selected for processing (9)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/integration-tests.yml (2 hunks)
  • .github/workflows/unit-tests.yml (1 hunks)
  • ci/php-cs-fixer/config.php (1 hunks)
  • docs/CONTRIBUTING.md (2 hunks)
  • src/MartinGeorgiev/Doctrine/DBAL/Types/BaseIntegerArray.php (3 hunks)
  • src/MartinGeorgiev/Doctrine/DBAL/Types/SpatialDataArray.php (1 hunks)
  • src/MartinGeorgiev/Utils/PHPArrayToPostgresValueTransformer.php (1 hunks)
  • tests/Unit/MartinGeorgiev/Utils/PHPArrayToPostgresValueTransformerTest.php (0 hunks)
💤 Files with no reviewable changes (1)
  • tests/Unit/MartinGeorgiev/Utils/PHPArrayToPostgresValueTransformerTest.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/integration-tests.yml
  • .github/workflows/unit-tests.yml
⏰ 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). (15)
  • GitHub Check: Code Quality
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.5
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.5
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.3
  • GitHub Check: PostgreSQL 18 + PostGIS 3.6 + PHP 8.1
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.3
  • GitHub Check: PostgreSQL 17 + PostGIS 3.6 + PHP 8.1
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + 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.5 + PHP 8.1
  • GitHub Check: PHP 8.5 + Doctrine ORM 2.14 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0
  • GitHub Check: sloth
  • GitHub Check: wait-for-tests-worflows-before-upload
🔇 Additional comments (8)
src/MartinGeorgiev/Utils/PHPArrayToPostgresValueTransformer.php (1)

33-33: LGTM! Modernizes callable syntax for consistency.

The change from string callable 'is_array' to first-class callable is_array(...) is a good modernization that aligns with PHP 8.1+ best practices. This also makes the code consistent with line 39, which already uses the same syntax for self::formatValue(...).

src/MartinGeorgiev/Doctrine/DBAL/Types/SpatialDataArray.php (1)

203-203: LGTM! Modern first-class callable syntax.

The switch to trim(...) syntax is a clean modernization that leverages PHP 8.1's first-class callable feature. This is more type-safe than passing the function name as a string while maintaining identical functionality.

docs/CONTRIBUTING.md (2)

131-132: Documentation updated to reflect PHP 8.5 support and improved hyphenation.

The documentation now correctly reflects PHP 8.5 as the example version for local development, and "PostgreSQL-related" is properly hyphenated for consistency with modern style conventions.


142-142: Example configuration updated to use PHP 8.5.

The devenv.local.nix example now shows PHP 8.5, which aligns with the minimum supported version being updated in this PR.

.github/workflows/ci.yml (1)

49-49: PHP 8.5 support is complete across all workflow files and configuration.

Verification confirms that all requested files have been consistently updated:

  • .github/workflows/ci.yml: PHP 8.5 set at line 49 ✓
  • .github/workflows/integration-tests.yml: PHP 8.5 included in matrix ✓
  • .github/workflows/unit-tests.yml: PHP 8.5 included in matrix ✓
  • composer.json: Constraint correctly set to ^8.1 <8.6

No further changes needed.

src/MartinGeorgiev/Doctrine/DBAL/Types/BaseIntegerArray.php (3)

90-93: LGTM! Excellent refactoring.

The new helper method properly encapsulates the integer-fit check using FILTER_VALIDATE_INT, which correctly respects platform-dependent PHP_INT_MAX and PHP_INT_MIN limits. The !== false comparison correctly handles the case where "0" validates to 0.


47-47: LGTM! Correct usage of the helper.

The helper is correctly used here to validate that the string value fits in a PHP integer before proceeding with the cast and range validation. This eliminates code duplication while maintaining the correct validation flow.


77-77: LGTM! Consistent usage of the helper.

The helper is correctly applied here as well, maintaining consistency with the database validation path and completing the refactoring to eliminate duplicated logic.

@coveralls
Copy link

coveralls commented Oct 23, 2025

Coverage Status

coverage: 95.709%. first build
when pulling a2edf8b on support-php85
into 70a6675 on main.

@martin-georgiev martin-georgiev merged commit a0eb098 into main Oct 23, 2025
90 of 91 checks passed
@martin-georgiev martin-georgiev deleted the support-php85 branch October 23, 2025 14:23
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