Skip to content

Conversation

@martin-georgiev
Copy link
Owner

@martin-georgiev martin-georgiev commented Apr 22, 2025

Summary by CodeRabbit

  • Tests
    • Updated type declarations for mock properties in multiple test classes to use a more general mock object type, improving consistency in test code. No changes to test logic or behavior.

@coderabbitai
Copy link

coderabbitai bot commented Apr 22, 2025

Walkthrough

This update standardizes the type declarations of mock properties in multiple PHPUnit test classes. Specifically, private properties previously typed as concrete classes (such as AbstractPlatform or custom types) combined with MockObject are now uniformly typed as MockObject only. These changes affect the static type hints of properties representing mocked dependencies but do not alter their initialization or test logic. The modifications are limited to type declarations and do not impact the runtime behavior or control flow of the tests.

Changes

Files Change Summary
tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseArrayTest.php Changed type declarations of $platform and $fixture from specific types/intersections to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseNetworkTypeArrayTest.php Changed type declaration of $platform from AbstractPlatform (intersection) to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php Changed type declaration of $platform from AbstractPlatform to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/BooleanArrayTest.php Changed type declaration of $platform from AbstractPlatform (intersection) to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/CidrArrayTest.php
tests/MartinGeorgiev/Doctrine/DBAL/Types/CidrTest.php
Changed type declaration of $platform from AbstractPlatform (intersection) to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/InetArrayTest.php
tests/MartinGeorgiev/Doctrine/DBAL/Types/InetTest.php
Changed type declaration of $platform from AbstractPlatform (intersection) to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/JsonbArrayTest.php
tests/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php
Changed type declaration of $platform from AbstractPlatform (intersection) to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/MacaddrArrayTest.php
tests/MartinGeorgiev/Doctrine/DBAL/Types/MacaddrTest.php
Changed type declaration of $platform from AbstractPlatform (intersection) to MockObject.
tests/MartinGeorgiev/Doctrine/DBAL/Types/TextArrayTest.php Changed type declaration of $platform from AbstractPlatform (intersection) to MockObject.

Possibly related PRs

Poem

In the warren where tests abound,
Type hints shift without a sound.
MockObject hops in, bold and bright,
Replacing old types left and right.
Now our tests are neat and spry—
A rabbit’s wink, a coder’s sigh!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e09db0f and bf9392a.

📒 Files selected for processing (13)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseArrayTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseNetworkTypeArrayTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/BooleanArrayTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/CidrArrayTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/CidrTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/InetArrayTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/InetTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/JsonbArrayTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/MacaddrArrayTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/MacaddrTest.php (1 hunks)
  • tests/MartinGeorgiev/Doctrine/DBAL/Types/TextArrayTest.php (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest
  • GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0
  • GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest
  • GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest
  • GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest
  • GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest
  • GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest
  • GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0
  • GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest
  • GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest
  • GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0
  • GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0
  • GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1
  • GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1
  • GitHub Check: sloth
🔇 Additional comments (14)
tests/MartinGeorgiev/Doctrine/DBAL/Types/InetArrayTest.php (1)

18-18: Appropriate type simplification to PHPUnit mock

The property type declaration has been simplified from the intersection type to just MockObject, while maintaining the detailed type information in the PHPDoc. This is a good standardization that aligns with modern PHP type handling and PHPUnit practices.

tests/MartinGeorgiev/Doctrine/DBAL/Types/BooleanArrayTest.php (1)

17-17: Type declaration standardization looks good

The change simplifies the property type to MockObject while preserving the detailed type information in the PHPDoc annotation. The runtime behavior remains unchanged since the property is still initialized with createMock(AbstractPlatform::class).

tests/MartinGeorgiev/Doctrine/DBAL/Types/JsonbArrayTest.php (1)

18-18: Clean type declaration simplification

Good standardization of the property type to use only MockObject while keeping the intersection type in the PHPDoc. This creates consistency across test files without changing test behavior.

tests/MartinGeorgiev/Doctrine/DBAL/Types/InetTest.php (1)

19-19: Type declaration properly standardized

The property type has been appropriately simplified to MockObject, consistent with the changes in other test files. This maintains the detailed typing through PHPDoc while standardizing the actual property declaration.

tests/MartinGeorgiev/Doctrine/DBAL/Types/CidrTest.php (1)

16-19: Type declaration change looks good!

Changed property type from AbstractPlatform&MockObject (in docblock) to just MockObject. This is a good standardization of type declarations for mock objects while preserving the runtime behavior since the property is still initialized with createMock(AbstractPlatform::class).

tests/MartinGeorgiev/Doctrine/DBAL/Types/MacaddrTest.php (1)

16-19: Type declaration change looks good!

Changed property type from AbstractPlatform&MockObject (in docblock) to just MockObject. This standardization of mock property types doesn't affect the runtime behavior since the property is still initialized with createMock(AbstractPlatform::class) in the setUp method.

tests/MartinGeorgiev/Doctrine/DBAL/Types/CidrArrayTest.php (1)

15-18: Type declaration change looks good!

Changed property type from AbstractPlatform&MockObject (in docblock) to just MockObject. This standardization maintains consistent mock typing across the test suite while preserving runtime behavior since the property is still initialized with createMock(AbstractPlatform::class).

tests/MartinGeorgiev/Doctrine/DBAL/Types/TextArrayTest.php (1)

14-17: Type declaration change looks good!

Changed property type from AbstractPlatform&MockObject (in docblock) to just MockObject. This aligns with the standardization pattern applied across all test classes and doesn't affect actual test behavior since the property is still initialized with createMock(AbstractPlatform::class).

tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseTypeTest.php (1)

17-17: Type declaration standardization looks good.

The property type has been simplified from AbstractPlatform to MockObject while retaining the full intersection type in the PHPDoc. This change aligns with modern PHPUnit practices for type-hinting mocked dependencies.

tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseNetworkTypeArrayTest.php (1)

17-17: Type declaration refactoring looks good.

The property type has been updated from AbstractPlatform to MockObject while preserving the full type information in the PHPDoc. This maintains the correct type information for static analysis tools while standardizing the property declaration.

tests/MartinGeorgiev/Doctrine/DBAL/Types/MacaddrArrayTest.php (1)

18-18: Type declaration standardization approved.

The property type has been simplified from AbstractPlatform to MockObject while maintaining the complete type information in the PHPDoc annotation. This change follows consistent patterns applied across the test suite.

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

17-17: Type declaration refactoring is appropriate.

The property type has been changed from AbstractPlatform to MockObject while keeping the full type information in the PHPDoc. This standardizes mock property declarations across the test suite without changing runtime behavior.

tests/MartinGeorgiev/Doctrine/DBAL/Types/BaseArrayTest.php (2)

18-18: Type declaration simplified for mock object.

The property type has been changed from AbstractPlatform&MockObject to just MockObject, while retaining the PHPDoc annotation. This simplifies the property declaration while maintaining type information in the documentation.


23-23: Type declaration simplified for mock object.

Similar to the previous change, the property type has been simplified from BaseArray&MockObject to just MockObject, with type information preserved in the PHPDoc. This change is consistent with modern PHPUnit practices for handling mock objects.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@martin-georgiev martin-georgiev merged commit 7f3aff7 into main Apr 22, 2025
6 of 90 checks passed
@martin-georgiev martin-georgiev deleted the rector branch April 22, 2025 14:15
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.

2 participants