Commit e25bc4b
committed
minor #36799 Remove some magic from TypeValidator logic and OptionsResolver type verify logic (drealecs)
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
Remove some magic from TypeValidator logic and OptionsResolver type verify logic
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
Following discussion on https://twitter.com/Ocramius/status/1260236117129015297
The changes in this PR could ensure that types that can be verified by the TypeValidator is limited and there is no way to magically use it.
For example you can break it by defining you own function like:
```php
function is_usercollection {
return true;
}
```
that will validate any value that have the validator type as 'UserCollection'.
Another example would be defining `is_lower` or `ctype_int` that would also break the implementation.
Commits
-------
e8c9049a5a Remove some magic from TypeValidator logic and OptionsResolver type verify logic2 files changed
+23
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
30 | 50 | | |
31 | 51 | | |
32 | 52 | | |
| |||
110 | 130 | | |
111 | 131 | | |
112 | 132 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 133 | | |
120 | 134 | | |
121 | 135 | | |
| |||
996 | 1010 | | |
997 | 1011 | | |
998 | 1012 | | |
999 | | - | |
1000 | | - | |
1001 | 1013 | | |
1002 | 1014 | | |
1003 | 1015 | | |
| |||
1008 | 1020 | | |
1009 | 1021 | | |
1010 | 1022 | | |
1011 | | - | |
| 1023 | + | |
1012 | 1024 | | |
1013 | 1025 | | |
1014 | 1026 | | |
| |||
1136 | 1148 | | |
1137 | 1149 | | |
1138 | 1150 | | |
1139 | | - | |
| 1151 | + | |
1140 | 1152 | | |
1141 | 1153 | | |
1142 | 1154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments