Skip to content

Commit

Permalink
PHPLIB-1597 Accept a $-prefixed string anywhere an expression is acce…
Browse files Browse the repository at this point in the history
…pted
  • Loading branch information
GromNaN committed Jan 23, 2025
1 parent 3a8a0a7 commit 1b8896a
Show file tree
Hide file tree
Showing 187 changed files with 1,849 additions and 1,800 deletions.
6 changes: 6 additions & 0 deletions generator/config/expressions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use MongoDB\Model\BSONArray;
use stdClass;

use function in_array;
use function ucfirst;

$bsonTypes = [
Expand Down Expand Up @@ -45,6 +46,11 @@
$expressions = [];
$resolvesToInterfaces = [];
foreach ($bsonTypes as $name => $acceptedTypes) {
// an expression can be a string with a $-prefixed field name
if (! in_array('string', $acceptedTypes)) {
$acceptedTypes[] = 'string';
}

$expressions[$name] = ['acceptedTypes' => $acceptedTypes];

$resolvesTo = 'resolvesTo' . ucfirst($name);
Expand Down
16 changes: 8 additions & 8 deletions src/Builder/Accumulator/AccumulatorAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Builder/Accumulator/AvgAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Builder/Accumulator/BottomAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/Builder/Accumulator/BottomNAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/Builder/Accumulator/CovariancePopAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/Builder/Accumulator/CovarianceSampAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Builder/Accumulator/DerivativeAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions src/Builder/Accumulator/ExpMovingAvgAccumulator.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1b8896a

Please sign in to comment.