3 abstract class ReleephFieldSelector
extends Phobject
{
5 final public function __construct() {
9 abstract public function getFieldSpecifications();
11 public function sortFieldsForCommitMessage(array $fields) {
12 assert_instances_of($fields, 'ReleephFieldSpecification');
16 protected static function selectFields(array $fields, array $classes) {
17 assert_instances_of($fields, 'ReleephFieldSpecification');
20 foreach ($fields as $field) {
21 $map[get_class($field)] = $field;
25 foreach ($classes as $class) {
26 $field = idx($map, $class);
30 "Tried to select a in instance of '%s' but that field ".
31 "is not configured for this project!",
35 if (idx($result, $class)) {
38 "You have asked to select the field '%s' more than once!",
42 $result[$class] = $field;