Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/maniphest/constants/ManiphestTaskPoints.php
12256 views
1
<?php
2
3
final class ManiphestTaskPoints extends Phobject {
4
5
public static function getIsEnabled() {
6
$config = self::getPointsConfig();
7
return idx($config, 'enabled');
8
}
9
10
public static function getPointsLabel() {
11
$config = self::getPointsConfig();
12
return idx($config, 'label', pht('Points'));
13
}
14
15
public static function getPointsActionLabel() {
16
$config = self::getPointsConfig();
17
return idx($config, 'action', pht('Change Points'));
18
}
19
20
private static function getPointsConfig() {
21
return PhabricatorEnv::getEnvConfig('maniphest.points');
22
}
23
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.'));
30
}
31
32
PhutilTypeSpec::checkMap(
33
$config,
34
array(
35
'enabled' => 'optional bool',
36
'label' => 'optional string',
37
'action' => 'optional string',
38
));
39
}
40
41
}
42
43