Skip to content

Commit 66977a6

Browse files
committed
PHPLIB-1597 Accept a $-prefixed string anywhere an expression is accepted
1 parent fd8dd43 commit 66977a6

File tree

185 files changed

+1793
-1744
lines changed

Some content is hidden

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

185 files changed

+1793
-1744
lines changed

generator/config/expressions.php

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use MongoDB\Model\BSONArray;
1414
use stdClass;
1515

16+
use function in_array;
1617
use function ucfirst;
1718

1819
$bsonTypes = [
@@ -45,6 +46,11 @@
4546
$expressions = [];
4647
$resolvesToInterfaces = [];
4748
foreach ($bsonTypes as $name => $acceptedTypes) {
49+
// an expression can be a string with a $-prefixed field name
50+
if (! in_array('string', $acceptedTypes)) {
51+
$acceptedTypes[] = 'string';
52+
}
53+
4854
$expressions[$name] = ['acceptedTypes' => $acceptedTypes];
4955

5056
$resolvesTo = 'resolvesTo' . ucfirst($name);

src/Builder/Accumulator/AccumulatorAccumulator.php

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/AvgAccumulator.php

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/BottomNAccumulator.php

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/CovariancePopAccumulator.php

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/CovarianceSampAccumulator.php

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/DerivativeAccumulator.php

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Accumulator/ExpMovingAvgAccumulator.php

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)