Commit 8460cc9
committed
bug symfony#61076 [ExpressionLanguage] Fix dumping of null safe operator (ivantsepp)
This PR was merged into the 6.4 branch.
Discussion
----------
[ExpressionLanguage] Fix dumping of null safe operator
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | n/a
| License | MIT
I noticed that when you dump an expression that uses null safe operator, the returned string doesn't maintain the null safe operator.
```php
> (new ExpressionLanguage())->parse('user?.foo', ['user'])->getNodes()->dump()
= "user.foo"
```
I would have expected `user?.foo` to be returned instead.
(I've also fixed some test data providers cases - `getDumpData` provider should only generate cases with 2 elements but some tests are including a third argument. So I went ahead and removed them)
Commits
-------
7cafcd2 [ExpressionLanguage] Fix dumping of null safe operatorFile tree
4 files changed
+12
-8
lines changed- src/Symfony/Component/ExpressionLanguage
- Node
- Tests
- Node
4 files changed
+12
-8
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | | - | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
387 | | - | |
388 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
56 | 57 | | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
0 commit comments