16
16
*/
17
17
class Configuration
18
18
{
19
- const GROUPS = ['total ' , 'indirect ' , 'direct ' , 'self ' ];
20
-
21
19
/**
22
20
* @var int[]
23
21
*/
@@ -46,9 +44,11 @@ class Configuration
46
44
*/
47
45
private function __construct (array $ thresholds = [], $ regex = '' , $ verboseOutput = true )
48
46
{
47
+ $ groups = ['total ' , 'indirect ' , 'direct ' , 'self ' ];
48
+
49
49
foreach ($ thresholds as $ group => $ threshold ) {
50
- if (!\in_array ($ group , self :: GROUPS , true )) {
51
- throw new \InvalidArgumentException (sprintf ('Unrecognized threshold "%s", expected one of "%s" ' , $ group , implode ('", " ' , self :: GROUPS )));
50
+ if (!\in_array ($ group , $ groups , true )) {
51
+ throw new \InvalidArgumentException (sprintf ('Unrecognized threshold "%s", expected one of "%s" ' , $ group , implode ('", " ' , $ groups )));
52
52
}
53
53
if (!is_numeric ($ threshold )) {
54
54
throw new \InvalidArgumentException (sprintf ('Threshold for group "%s" has invalid value "%s" ' , $ group , $ threshold ));
@@ -66,7 +66,7 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
66
66
'self ' => $ this ->thresholds ['indirect ' ],
67
67
];
68
68
}
69
- foreach (self :: GROUPS as $ group ) {
69
+ foreach ($ groups as $ group ) {
70
70
if (!isset ($ this ->thresholds [$ group ])) {
71
71
$ this ->thresholds [$ group ] = 999999 ;
72
72
}
0 commit comments