These parameters wrongly extend List.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- rPdc6d108b26cf: Paramater type inheritence fix
Used createdStart field for a search - didn't get error about "should be a list".
git grep 'extends ConduitListParameterType'.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/applications/conduit/parametertype/ConduitEpochParameterType.php | ||
---|---|---|
42–44 | I'd expect this to just be null, any particular reason for this? |
src/applications/conduit/parametertype/ConduitEpochParameterType.php | ||
---|---|---|
42–44 | I just assumed this needs to be a valid value. |
Default to null (Using parent's method).
src/applications/conduit/parametertype/ConduitEpochParameterType.php | ||
---|---|---|
42–44 | The default value of List is "empty list", which is why I thought "0" here. |
I think nothing actually uses it right now, but null is more consistent with the behavior of ConduitIntParameterType, $request->getInt(), $request->getStr(), etc.
Defaulting the List type to array() is just so that you can do this sort of thing:
$value = $some_list_value->getValue(); $added = array_diff($value, $old); // <-- Always safe, don't need to check for null.
There's generally no similar simplification available for giving other types defaults other than null.