Skip to content

PHPLIB-1715: Support string to array conversion#1915

Merged
paulinevos merged 1 commit into
mongodb:v2.xfrom
paulinevos:toArray
Jun 11, 2026
Merged

PHPLIB-1715: Support string to array conversion#1915
paulinevos merged 1 commit into
mongodb:v2.xfrom
paulinevos:toArray

Conversation

@paulinevos

@paulinevos paulinevos commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@paulinevos paulinevos requested a review from a team as a code owner June 3, 2026 10:23
Copilot AI review requested due to automatic review settings June 3, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds builder support and corresponding test fixtures for MongoDB 8.3’s $toArray (including string→array conversion) and $toObject (string→object conversion) aggregation expression operators, aligning the fluent Expression::* API with newly documented server features.

Changes:

  • Introduces new auto-generated expression operator classes: ToArrayOperator and ToObjectOperator.
  • Adds Expression::toArray() and Expression::toObject() factory methods (via FactoryTrait).
  • Adds pipeline fixture JSON and PHPUnit tests covering string conversion examples for both operators.

Reviewed changes

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

Show a summary per file
File Description
tests/Builder/Expression/ToObjectOperatorTest.php Adds a pipeline test for $toObject string→object conversion.
tests/Builder/Expression/ToArrayOperatorTest.php Adds pipeline tests for $toArray (BinData→array and string→array).
tests/Builder/Expression/Pipelines.php Adds expected JSON fixtures for $toArray string conversion and $toObject string conversion.
src/Builder/Expression/ToObjectOperator.php Adds the $toObject operator class (auto-generated).
src/Builder/Expression/ToArrayOperator.php Adds the $toArray operator class (auto-generated).
src/Builder/Expression/FactoryTrait.php Exposes toArray() and toObject() factory methods on Expression.
psalm-baseline.xml Removes an unused baseline suppression for NoDiscard attributes.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@paulinevos paulinevos force-pushed the toArray branch 2 times, most recently from bbccc71 to 24023c3 Compare June 4, 2026 14:10
Copilot AI review requested due to automatic review settings June 4, 2026 14:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@alcaeus alcaeus removed their request for review June 8, 2026 06:52
Comment thread tests/Builder/Expression/ToArrayOperatorTest.php Outdated
Comment thread tests/Builder/Expression/ToArrayOperatorTest.php Outdated
@paulinevos paulinevos enabled auto-merge (squash) June 8, 2026 10:19
Copilot AI review requested due to automatic review settings June 8, 2026 14:18
@paulinevos paulinevos disabled auto-merge June 8, 2026 14:18
@paulinevos paulinevos enabled auto-merge (rebase) June 8, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread tests/Builder/Expression/ToArrayOperatorTest.php Outdated
Copilot AI review requested due to automatic review settings June 9, 2026 12:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@paulinevos paulinevos merged commit 0427cac into mongodb:v2.x Jun 11, 2026
36 checks passed
@paulinevos paulinevos deleted the toArray branch June 11, 2026 08:23
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.

5 participants