@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3abstract class HarbormasterBuildStepGroup extends Phobject {
4
5 abstract public function getGroupName();
6 abstract public function getGroupOrder();
7
8 public function isEnabled() {
9 return true;
10 }
11
12 public function shouldShowIfEmpty() {
13 return true;
14 }
15
16 final public function getGroupKey() {
17 return $this->getPhobjectClassConstant('GROUPKEY');
18 }
19
20 final public static function getAllGroups() {
21 return id(new PhutilClassMapQuery())
22 ->setAncestorClass(self::class)
23 ->setUniqueMethod('getGroupKey')
24 ->setSortMethod('getGroupOrder')
25 ->execute();
26 }
27
28 final public static function getAllEnabledGroups() {
29 $groups = self::getAllGroups();
30
31 foreach ($groups as $key => $group) {
32 if (!$group->isEnabled()) {
33 unset($groups[$key]);
34 }
35 }
36
37 return $groups;
38 }
39
40}