Skip to content

Conversation

@alcaeus
Copy link
Member

@alcaeus alcaeus commented Oct 22, 2025

PHPLIB-1740

This allows using tagged services in the Symfony DIC.

@alcaeus alcaeus requested a review from GromNaN October 22, 2025 11:46
@alcaeus alcaeus requested a review from a team as a code owner October 22, 2025 11:46
@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 11:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the BuilderEncoder constructor to accept iterables instead of only arrays for custom encoders, enabling compatibility with Symfony's Dependency Injection Container tagged services.

  • Changed the $encoders parameter type from array to iterable
  • Added logic to convert non-array iterables to arrays
  • Added test coverage for the iterable functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Builder/BuilderEncoder.php Updated constructor to accept iterable encoders and convert them to arrays
tests/Builder/BuilderEncoderTest.php Added test case verifying iterable encoder support using a Generator

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@alcaeus alcaeus force-pushed the phplib-1740-builder-encoder-accept-iterable branch from 88127be to 9b40e31 Compare October 22, 2025 11:51
@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.74%. Comparing base (cfae2e1) to head (9b40e31).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               v2.x    #1790   +/-   ##
=========================================
  Coverage     87.73%   87.74%           
- Complexity     3194     3195    +1     
=========================================
  Files           424      424           
  Lines          6352     6354    +2     
=========================================
+ Hits           5573     5575    +2     
  Misses          779      779           
Flag Coverage Δ
6.0-replica_set 85.69% <100.00%> (+<0.01%) ⬆️
6.0-server 81.71% <100.00%> (+<0.01%) ⬆️
6.0-sharded_cluster 85.28% <100.00%> (+<0.01%) ⬆️
8.0-replica_set 87.66% <100.00%> (+<0.01%) ⬆️
8.0-server 82.59% <100.00%> (+<0.01%) ⬆️
8.0-sharded_cluster 87.33% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GromNaN
Copy link
Member

GromNaN commented Oct 22, 2025

  • Coverage -0.03%

Weird.

@alcaeus alcaeus merged commit b25b5d0 into mongodb:v2.x Oct 23, 2025
33 checks passed
@alcaeus alcaeus deleted the phplib-1740-builder-encoder-accept-iterable branch October 23, 2025 06:58
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