Skip to content

Commit ca19c38

Browse files
committed
PHPLIB-1634: Support encoding DateTimeInterface instances in aggregation builder
1 parent 85447eb commit ca19c38

File tree

111 files changed

+993
-769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+993
-769
lines changed

generator/config/expressions.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace MongoDB\Builder\Expression;
88

9+
use DateTimeInterface;
910
use MongoDB\BSON;
1011
use MongoDB\Builder\Pipeline;
1112
use MongoDB\Builder\Type;
@@ -26,7 +27,7 @@
2627
'binData' => ['string', BSON\Binary::class],
2728
'objectId' => [BSON\ObjectId::class],
2829
'bool' => ['bool'],
29-
'date' => [BSON\UTCDateTime::class],
30+
'date' => [BSON\UTCDateTime::class, DateTimeInterface::class],
3031
'null' => ['null'],
3132
'regex' => [BSON\Regex::class],
3233
'javascript' => ['string', BSON\Javascript::class],
@@ -37,7 +38,7 @@
3738
];
3839

3940
// "any" accepts all the BSON types. No generic "object" or "mixed"
40-
$bsonTypes['any'] = ['bool', 'int', 'float', 'string', 'array', 'null', stdClass::class, BSON\Type::class];
41+
$bsonTypes['any'] = ['bool', 'int', 'float', 'string', 'array', 'null', stdClass::class, BSON\Type::class, DateTimeInterface::class];
4142

4243
// "number" accepts all the numeric types
4344
$bsonTypes['number'] = ['int', 'float', BSON\Int64::class, BSON\Decimal128::class];

src/Builder/Accumulator/AddToSetAccumulator.php

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/BottomAccumulator.php

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/BottomNAccumulator.php

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/DerivativeAccumulator.php

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)