Skip to content

Commit 961f518

Browse files
committed
Rename noName to wrapObject
1 parent 6c0acf3 commit 961f518

File tree

7 files changed

+67
-2223
lines changed

7 files changed

+67
-2223
lines changed

generator/config/expression/case.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch
44
type:
55
- switchBranch
66
encode: object
7-
noName: true
7+
wrapObject: false
88
description: |
99
Represents a single case in a $switch expression
1010
arguments:

generator/config/schema.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
"$comment": "The description of the argument from MongoDB's documentation.",
6969
"type": "string"
7070
},
71-
"noName": {
72-
"$comment": "Don't wrap the properties in an object with the operator name",
71+
"wrapObject": {
72+
"$comment": "Wrap the properties in an object with the operator name",
7373
"type": "boolean",
74-
"default": false
74+
"default": true
7575
},
7676
"arguments": {
7777
"$comment": "An optional list of arguments for the operator.",

generator/src/Definition/OperatorDefinition.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
/** @var list<string> */
3333
public array $type,
3434
public string|null $description = null,
35-
public bool $noName = false,
35+
public bool $wrapObject = true,
3636
array $arguments = [],
3737
array $tests = [],
3838
) {

generator/src/OperatorClassGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function createClass(GeneratorDefinition $definition, OperatorDefinition
6161
$class->addComment('@internal');
6262
$namespace->addUse(Encode::class);
6363
$class->addConstant('ENCODE', new Literal('Encode::' . $operator->encode->name));
64-
$class->addConstant('NAME', $operator->noName ? null : $operator->name);
64+
$class->addConstant('NAME', $operator->wrapObject ? $operator->name : null);
6565

6666
$encodeNames = [];
6767
$constructor = $class->addMethod('__construct');

0 commit comments

Comments
 (0)