Skip to content

Conversation

@martin-georgiev
Copy link
Owner

@martin-georgiev martin-georgiev commented Mar 13, 2025

Summary by CodeRabbit

  • New Features

    • Introduced enhanced array query functionality with improved argument validation for more reliable operations.
    • Streamlined automation scripts for code quality checks and testing, simplifying maintenance and usage.
    • Expanded PHPStan configuration to analyze additional directories and refined error handling.
  • Tests

    • Added comprehensive tests to confirm the accuracy and robustness of the updated array query behavior.

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2025

Walkthrough

The changes introduce new script entries in the composer.json file and update existing script references to use these new entries. In addition, the Arr class in the Doctrine ORM query AST now extends BaseVariadicFunction, includes a new property for node mapping, and introduces a new method to validate function arguments. Finally, a new test class (ArrTest) has been added to validate the behavior of the updated Arr function with expected SQL and DQL outputs.

Changes

File(s) Change Summary
composer.json Added new scripts: "deptrac", "php-cs-fixer", "phpstan", "phpunit", and "rector". Modified existing scripts ("check-code-style", "fix-code-style", "run-static-analysis", "run-tests", "run-tests-with-clover") to reference the new script entries.
src/MartinGeorgiev/.../Arr.php Updated Arr to extend BaseVariadicFunction instead of BaseFunction. Added a protected property commonNodeMapping (set to 'StringPrimary') and a new method validateArguments that enforces at least one argument, throwing an exception if none are provided.
tests/MartinGeorgiev/.../ArrTest.php Introduced a new test class ArrTest to test the functionality of the Arr function by providing expected SQL and DQL statements for various argument scenarios.
ci/phpstan/config.neon Updated paths to include - ../../ci, removed checkMissingIterableValueType, and added ignoreErrors with - identifier: missingType.iterableValue.
.github/workflows/ci.yml Removed references to composer-flags in job names and commands, simplified installation commands, and adjusted flag names in the upload coverage step.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant A as Arr Function
    participant V as ValidateArguments
    U->>A: Call ARRAY function with args
    A->>V: Validate arguments
    alt No arguments provided
        V-->>A: Throw InvalidArgumentForVariadicFunctionException
        A-->>U: Return error
    else Valid arguments
        V-->>A: Validation success
        A-->>U: Return processed result
    end
Loading

Poem

I'm a bouncy rabbit in the code-filled glen,
Hopping through scripts with a joyful pen.
New fixes and tests make my heart leap high,
As functions now dance beneath a clearer sky.
With each gentle hop, our code sings anew—
A merry tale of changes, fresh as morning dew!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

🪧 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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.

Documentation and Community

  • 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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 13, 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: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86e6eb6 and 71d3ab8.

📒 Files selected for processing (2)
  • ci/phpstan/config.neon (1 hunks)
  • composer.json (1 hunks)
🔇 Additional comments (4)
ci/phpstan/config.neon (2)

8-8: Good addition of CI directory to PHPStan analysis paths.

Including the CI scripts in static analysis is a good practice that helps identify issues in your build scripts early.


13-16: Well-structured PHPStan configuration update.

The change from using the direct configuration checkMissingIterableValueType: false to using the identifier-based ignore system with identifier: missingType.iterableValue is a good modernization. This follows current PHPStan best practices and allows for more granular control over ignored errors.

composer.json (2)

63-77: Well-organized script definitions with clear tool configurations.

Extracting individual tool commands into named scripts is an excellent practice. This improves maintainability, makes the CI configuration more readable, and allows for easier updates to tool configurations in the future.


79-82: Good refactoring of composite scripts to reference individual tool scripts.

Updating the composite scripts to reference the individual tool scripts using the @script-name syntax is a good practice. This makes the configuration more DRY and easier to maintain.

Also applies to: 83-86, 87-90, 91-93, 94-96

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 13, 2025
# Conflicts:
#	composer.json
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 (3)
.github/workflows/ci.yml (3)

14-14: Simplified CI Job Name

Updating the CI job name to "PHP ${{ matrix.php }} + Doctrine ORM ${{ matrix.doctrine-orm }}" streamlines the output and better reflects the current testing strategy by removing legacy references (e.g., to composer-flags).


55-57: Composer Dependency Command for doctrine/orm "2.14"

The conditional correctly installs doctrine/orm with version "~2.14" when matrix.doctrine-orm equals "2.14". Consider verifying that the use of == in the shell comparison behaves consistently in your CI environment; in strict POSIX shells a single = might be more portable.


57-59: Composer Dependency Command for doctrine/orm "3.0"

Similarly, the conditional installs doctrine/orm with version "~3.0" when matrix.doctrine-orm is "3.0". As with the previous comment, ensure that the comparison operator is supported in your CI shell—or consider using a single = for broad compatibility.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aad60ab and d879fd3.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (3 hunks)
  • composer.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • composer.json
🔇 Additional comments (2)
.github/workflows/ci.yml (2)

59-61: Fallback to Composer Update

The fallback composer update --prefer-dist --no-interaction --no-progress is a clear approach when the matrix.doctrine-orm condition doesn’t match specific versions. Double-check that this behavior is intended for all other cases during the CI run.


83-83: Streamlined Coverage Upload Flag Naming

Changing the flag name to "PHP ${{ matrix.php }}" removes the now-unnecessary complexity of the previous composer-flags references. This simplification aligns well with the overall goal of streamlining the CI configuration.

@coveralls
Copy link

Coverage Status

coverage: 95.552% (-0.1%) from 95.677%
when pulling d879fd3 on variadic-array
into c1c9930 on main.

@martin-georgiev martin-georgiev merged commit 7f2b05d into main Mar 13, 2025
11 of 12 checks passed
@martin-georgiev martin-georgiev deleted the variadic-array branch March 13, 2025 18:46
@github-actions github-actions bot mentioned this pull request Mar 13, 2025
@github-actions github-actions bot mentioned this pull request Mar 30, 2025
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