Page MenuHomePhabricator

Paramater type inheritence fix
ClosedPublic

Authored by avivey on May 10 2016, 8:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 3:48 PM
Unknown Object (File)
Wed, Apr 24, 11:45 PM
Unknown Object (File)
Tue, Apr 23, 1:17 PM
Unknown Object (File)
Tue, Apr 23, 1:17 PM
Unknown Object (File)
Tue, Apr 23, 1:17 PM
Unknown Object (File)
Tue, Apr 23, 1:17 PM
Unknown Object (File)
Fri, Apr 12, 8:11 PM
Unknown Object (File)
Fri, Apr 12, 7:53 AM
Subscribers

Details

Summary

These parameters wrongly extend List.

Test Plan

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

avivey retitled this revision from to Paramater type inheritence fix.
avivey updated this object.
avivey edited the test plan for this revision. (Show Details)
avivey added a reviewer: epriestley.
epriestley edited edge metadata.
epriestley added inline comments.
src/applications/conduit/parametertype/ConduitEpochParameterType.php
42–44

I'd expect this to just be null, any particular reason for this?

This revision is now accepted and ready to land.May 10 2016, 8:24 PM
src/applications/conduit/parametertype/ConduitEpochParameterType.php
42–44

I just assumed this needs to be a valid value.

avivey edited edge metadata.

Default to null (Using parent's method).

src/applications/conduit/parametertype/ConduitEpochParameterType.php
42–44

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.

This revision was automatically updated to reflect the committed changes.