Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / maniphest / constants / ManiphestTaskPoints.php
blob55af72956b096bab91a7b3fc803635bbe2c8ea26
1 <?php
3 final class ManiphestTaskPoints extends Phobject {
5 public static function getIsEnabled() {
6 $config = self::getPointsConfig();
7 return idx($config, 'enabled');
10 public static function getPointsLabel() {
11 $config = self::getPointsConfig();
12 return idx($config, 'label', pht('Points'));
15 public static function getPointsActionLabel() {
16 $config = self::getPointsConfig();
17 return idx($config, 'action', pht('Change Points'));
20 private static function getPointsConfig() {
21 return PhabricatorEnv::getEnvConfig('maniphest.points');
24 public static function validateConfiguration($config) {
25 if (!is_array($config)) {
26 throw new Exception(
27 pht(
28 'Configuration is not valid. Maniphest points configuration must '.
29 'be a dictionary.'));
32 PhutilTypeSpec::checkMap(
33 $config,
34 array(
35 'enabled' => 'optional bool',
36 'label' => 'optional string',
37 'action' => 'optional string',
38 ));