Commit 1a1f81c
committed
bug symfony#59824 [TypeInfo] Add
This PR was merged into the 7.3 branch.
Discussion
----------
[TypeInfo] Add `CollectionType::mergeCollectionValueTypes()`
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | yes
| New feature? | yes
| Deprecations? | no
| Issues |
| License | MIT
At the moment, when calling the following code:
```php
$type = Type::fromValue([new \stdClass(), new \DateTimeImmutable()]);
```
used to throw an exception saying: `Cannot create union with both "object" and class type.`. This PR fixes that, allowing the method to return the proper `Type::list(Type::object())`.
It also creates the `CollectionType::mergeCollectionValueTypes()` method to encapsulate this logic (as it'll be used in future PRs).
Commits
-------
b990f68 [TypeInfo] Add `CollectionType::mergeCollectionValueTypes()`CollectionType::mergeCollectionValueTypes() (mtarld)File tree
5 files changed
+82
-25
lines changed- src/Symfony/Component/TypeInfo
- Tests
- Type
- Type
5 files changed
+82
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
137 | 159 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
55 | 108 | | |
56 | 109 | | |
57 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
409 | | - | |
410 | 408 | | |
411 | | - | |
412 | 409 | | |
413 | 410 | | |
414 | | - | |
415 | | - | |
| 411 | + | |
| 412 | + | |
416 | 413 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | 414 | | |
436 | 415 | | |
437 | | - | |
438 | 416 | | |
439 | 417 | | |
| 418 | + | |
| 419 | + | |
440 | 420 | | |
441 | 421 | | |
442 | 422 | | |
| |||
0 commit comments