Commit 978c639
authored
Allow passing explicit null values for optional input members (#1542)
This makes it easier to define the array literal for input objects as
PHP does not have a syntax sugar for conditional keys in an array
literal. This is consistent with the generated code for value objects.
Even though input objects allow to omit required members in the
constructor shape (as they can be set later by using the setter), the
phpdoc type still does not allow passing null explicitly (even though
the code would deal with it until the validation run) so that static
analysis tools can catch mistakes there. Passing a required member
explicitly is intended to pass a valid value for it and not a
potentially missing one.1 parent d425dfc commit 978c639
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
0 commit comments