Skip to content

Conversation

@martin-georgiev
Copy link
Owner

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

Summary by CodeRabbit

  • Style

    • Harmonized type annotation ordering across JSON-related components for consistency; no functional changes.
  • Tests

    • Updated test method signatures to align with revised type annotation ordering; behavior unchanged.
  • Chores

    • Optimized code style tooling to run in parallel for faster checks.
    • Adjusted development script configuration to simplify environment handling.

No user-facing functionality changes; these updates improve consistency, developer experience, and CI performance.

@martin-georgiev martin-georgiev marked this pull request as ready for review September 2, 2025 22:04
@martin-georgiev martin-georgiev enabled auto-merge (squash) September 2, 2025 22:04
@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 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 0 minutes and 8 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 5c60924 and eff9aab.

📒 Files selected for processing (2)
  • ci/php-cs-fixer/config.php (3 hunks)
  • composer.json (1 hunks)

Walkthrough

Adds php-cs-fixer parallelisation and allows unsupported PHP in CI config; removes PHP_CS_FIXER_IGNORE_ENV from Composer script. Reorders union type hints (placing null last) across JSON-related source methods and corresponding tests. No logic or control-flow changes.

Changes

Cohort / File(s) Summary
CI: php-cs-fixer configuration and script
ci/php-cs-fixer/config.php, composer.json
Config: adds setParallelisation() and setUnsupportedPhpVersionAllowed(true). Composer script: removes PHP_CS_FIXER_IGNORE_ENV=1 prefix; command otherwise unchanged.
Source: union type order adjustments
src/MartinGeorgiev/Doctrine/DBAL/Types/JsonTransformer.php, src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php, src/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformer.php
Reorder return type unions to end with null (array
Tests: union type order adjustments
tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php, tests/Unit/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformerTest.php
Update test method parameter union type order to place null last. No test logic changes.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A bunny taps keys with tidy delight,
Moves null to the end—now unions look right.
Fixers run swift, in parallel they hop,
CI hums softly—no env vars on top.
Carrot-shaped braces, whitespace just so,
Code fields are trimmed; onward we go! 🥕✨

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

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: 2

🧹 Nitpick comments (2)
src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php (1)

45-52: Union type reordering looks good; consider suppressing PHPMD noise

Reordering to place null last aligns with your fixer rules. To silence PHPMD “UnusedFormalParameter” for $platform, add a suppression on this method.

     /**
      * Converts a value from its database representation to its PHP representation of this type.
      *
      * @param string|null $value the value to convert
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
     public function convertToPHPValue($value, AbstractPlatform $platform): array|bool|float|int|string|null
tests/Unit/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformerTest.php (1)

18-18: Include float in union to mirror production return type

The transformer can yield floats; align the test parameter type accordingly to avoid static-analysis mismatch.

-    public function can_transform_json_to_php_value(array|bool|int|string|null $phpValue, string $postgresValue): void
+    public function can_transform_json_to_php_value(array|bool|float|int|string|null $phpValue, string $postgresValue): void

Optional: add a float case in the data provider:

'float' => [
    'phpValue' => 123.45,
    'postgresValue' => '123.45',
],
📜 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 2922b63 and 5c60924.

📒 Files selected for processing (7)
  • ci/php-cs-fixer/config.php (1 hunks)
  • composer.json (1 hunks)
  • src/MartinGeorgiev/Doctrine/DBAL/Types/JsonTransformer.php (1 hunks)
  • src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php (1 hunks)
  • src/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformer.php (1 hunks)
  • tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php (1 hunks)
  • tests/Unit/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformerTest.php (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 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/Unit/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php
  • tests/Unit/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformerTest.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/Unit/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php
📚 Learning: 2025-03-26T02:46:12.804Z
Learnt from: martin-georgiev
PR: martin-georgiev/postgresql-for-doctrine#0
File: :0-0
Timestamp: 2025-03-26T02:46:12.804Z
Learning: The PR "preserve the type of floats and integers when transforming back and forth between PostgreSQL and PHP" improves type handling by ensuring that integers remain integers, floats remain floats, numeric strings stay as strings, and booleans are properly converted through the transformation process.

Applied to files:

  • src/MartinGeorgiev/Doctrine/DBAL/Types/JsonTransformer.php
  • src/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformer.php
🧬 Code graph analysis (2)
src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php (2)
src/MartinGeorgiev/Doctrine/DBAL/Types/TextArray.php (1)
  • convertToPHPValue (54-61)
src/MartinGeorgiev/Doctrine/DBAL/Types/BaseArray.php (1)
  • convertToPHPValue (109-125)
tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php (2)
src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php (1)
  • convertToDatabaseValue (31-38)
tests/Unit/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformerTest.php (6)
  • DataProvider (16-21)
  • DataProvider (60-65)
  • DataProvider (88-93)
  • Test (112-118)
  • Test (120-126)
  • Test (128-134)
🪛 PHPMD (2.15.0)
src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php

45-45: Avoid unused parameters such as '$platform'. (Unused Code Rules)

(UnusedFormalParameter)

🪛 GitHub Actions: CI
ci/php-cs-fixer/config.php

[error] 57-57: Command 'php-cs-fixer fix --config=./ci/php-cs-fixer/config.php --show-progress=none --no-interaction --diff -v' failed with exit code 255. PHP Fatal error: Uncaught Error: Call to undefined method PhpCsFixer\Config::setParallelisation() in ci/php-cs-fixer/config.php:57

⏰ 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). (19)
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.2
  • GitHub Check: PostgreSQL 16 + PostGIS 3.5 + PHP 8.3
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.4
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.3
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.4
  • GitHub Check: PostgreSQL 16 + PostGIS 3.5 + PHP 8.2
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.2
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.1
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.3
  • GitHub Check: PostgreSQL 16 + PostGIS 3.4 + PHP 8.2
  • GitHub Check: PostgreSQL 17 + PostGIS 3.4 + PHP 8.3
  • GitHub Check: PostgreSQL 16 + PostGIS 3.5 + PHP 8.1
  • GitHub Check: PostgreSQL 17 + PostGIS 3.5 + PHP 8.1
  • GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest
  • GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest
  • GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0
  • GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest
  • GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1
  • GitHub Check: wait-for-tests-worflows-before-upload
🔇 Additional comments (3)
src/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformer.php (1)

56-64: LGTM: union type order updated, no behavior change

Matches project style; no further action.

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

35-38: LGTM: union type order updated, consistent with tests and config

No functional changes; consistent with phpdoc_types_order rule.

tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php (1)

40-40: LGTM: union reordered with null last and includes float

Matches the style goal and the src type signatures for JSON handling.

Also applies to: 47-47

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 2, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 2, 2025
@coveralls
Copy link

Coverage Status

coverage: 94.768%. remained the same
when pulling eff9aab on php-cs-fixer
into 2922b63 on main.

@martin-georgiev martin-georgiev merged commit 1de5aaf into main Sep 2, 2025
66 of 67 checks passed
@martin-georgiev martin-georgiev deleted the php-cs-fixer branch September 2, 2025 22:39
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