Commit cd24b4b
committed
feature symfony#59354 [OptionsResolver] Support union of types (VincentLanglet)
This PR was squashed before being merged into the 7.3 branch.
Discussion
----------
[OptionsResolver] Support union of types
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License | MIT
Add support for `|` syntax when describing allowedType in OptionResolver.
It's not really useful for `int|string` since we can pass an array `['string', 'int']`.
But it's useful for array values since `(int|string)[]` was not possible so far and `['string[]', 'int[]']` was not the same thing.
Commits
-------
69ec31d [OptionsResolver] Support union of typesFile tree
2 files changed
+124
-2
lines changed- src/Symfony/Component/OptionsResolver
- Tests
2 files changed
+124
-2
lines changedLines changed: 56 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
1142 | | - | |
| 1142 | + | |
1143 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1144 | 1164 | | |
1145 | 1165 | | |
1146 | 1166 | | |
| |||
1158 | 1178 | | |
1159 | 1179 | | |
1160 | 1180 | | |
1161 | | - | |
| 1181 | + | |
1162 | 1182 | | |
1163 | 1183 | | |
1164 | 1184 | | |
1165 | 1185 | | |
1166 | 1186 | | |
1167 | 1187 | | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1168 | 1222 | | |
1169 | 1223 | | |
1170 | 1224 | | |
| |||
Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
781 | 819 | | |
782 | 820 | | |
783 | 821 | | |
| |||
787 | 825 | | |
788 | 826 | | |
789 | 827 | | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
790 | 837 | | |
791 | 838 | | |
792 | 839 | | |
| |||
878 | 925 | | |
879 | 926 | | |
880 | 927 | | |
| 928 | + | |
881 | 929 | | |
882 | 930 | | |
883 | 931 | | |
| |||
1903 | 1951 | | |
1904 | 1952 | | |
1905 | 1953 | | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
1906 | 1974 | | |
1907 | 1975 | | |
1908 | 1976 | | |
| |||
0 commit comments