Skip to content
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

PHPLIB-1634: Support encoding DateTimeInterface instances in aggregation builder #1610

Merged
merged 7 commits into from
Feb 26, 2025

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Feb 26, 2025

PHPLIB-1634

With a new encoder, we only need to add DateTimeInterface to be accepted for the date type, as well as any. In addition, the stage factory needs manual updating, as well as some return types in the expression encoders.

@alcaeus alcaeus requested a review from GromNaN February 26, 2025 08:25
@alcaeus alcaeus requested a review from a team as a code owner February 26, 2025 08:25
*/
public static function match(QueryInterface|FieldQueryInterface|Type|stdClass|array|bool|float|int|string|null ...$queries): MatchStage
public static function match(QueryInterface|FieldQueryInterface|Type|stdClass|array|bool|float|int|string|DateTimeInterface|null ...$queries): MatchStage
Copy link
Member Author

Choose a reason for hiding this comment

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

This sent me on a short chase as I couldn't figure out why the match stage itself wasn't updated automatically. I forgot why we had to manually write this factory, but just leaving this here as a reminder for myself for the next time I have to make changes to the types accepted for $match.

@alcaeus alcaeus force-pushed the phplib-1634-accept-datetime-instances branch from ca19c38 to 71f7f5d Compare February 26, 2025 08:28
@alcaeus alcaeus enabled auto-merge (squash) February 26, 2025 09:10
@alcaeus alcaeus merged commit dd77c8d into mongodb:v1.x Feb 26, 2025
29 of 31 checks passed
This was referenced Feb 26, 2025
@alcaeus alcaeus deleted the phplib-1634-accept-datetime-instances branch February 26, 2025 11:41
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