-
-
Notifications
You must be signed in to change notification settings - Fork 56
chore: update PHP-CS-Fixer config #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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 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. 📒 Files selected for processing (2)
WalkthroughAdds 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
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this 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 noiseReordering to place
nulllast 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|nulltests/Unit/MartinGeorgiev/Utils/PostgresJsonToPHPArrayTransformerTest.php (1)
18-18: Include float in union to mirror production return typeThe 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): voidOptional: 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.
📒 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.phptests/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.phpsrc/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 changeMatches project style; no further action.
src/MartinGeorgiev/Doctrine/DBAL/Types/JsonTransformer.php (1)
35-38: LGTM: union type order updated, consistent with tests and configNo functional changes; consistent with
phpdoc_types_orderrule.tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php (1)
40-40: LGTM: union reordered with null last and includes floatMatches 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>
vibe code it :)
Summary by CodeRabbit
Style
Tests
Chores
No user-facing functionality changes; these updates improve consistency, developer experience, and CI performance.