Homec4science

Use classes to define standard field types and implement an "int" type

Authored by epriestley <git@epriestley.com> on Sep 17 2013, 01:03.

Description

Use classes to define standard field types and implement an "int" type

Summary:
Currently, ManiphestAuxiliaryFieldDefaultSpecification uses about a dozen giant switch statements to implement stadard field types (int, string, date, bool, select, user, remarkup, etc). This is:

  • pretty gross;
  • not extensible; and
  • doesn't really let us share that much code.

I got about halfway through porting a similar implementation into StandardField but I wasn't thrilled with it. Subclass StandardField instead to implement custom field types.

Test Plan: Added an "int" custom field, verified it had integer semantics and indexed into the integer index.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7005

Details

Committed
epriestley <git@epriestley.com>Sep 17 2013, 01:03
Pushed
aubortJan 31 2017, 17:16
Parents
rPHed126cd47ed0: Provide ApplicationSearch hooks in Maniphest
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH2b538bfb2575: Use classes to define standard field types and implement an "int" type (authored by epriestley <git@epriestley.com>).Sep 17 2013, 01:03