Conditions | 8 |
Paths | 25 |
Total Lines | 27 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function call() |
||
16 | { |
||
17 | $builder = $this->getBuilder(); |
||
18 | |||
19 | foreach ($this->params as $paramKey => $paramValue) { |
||
20 | $variable = is_numeric($paramKey) ? $paramValue : $paramKey; |
||
21 | $expectedValue = is_numeric($paramKey) ? null : $paramValue; |
||
22 | $checkValue = is_numeric($paramKey) ? false : true; |
||
23 | |||
24 | $value = config($variable, null); |
||
25 | |||
26 | if ($value === null) { |
||
27 | $builder->down(); |
||
28 | } else { |
||
29 | if ($checkValue && $value !== $expectedValue) { |
||
30 | $builder->down(); |
||
31 | } else { |
||
32 | $builder->up(); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | $builder->withData('variable', $variable) |
||
37 | ->withData('value', $value) |
||
38 | ->withData('value_expected', $expectedValue); |
||
39 | } |
||
40 | |||
41 | return $builder->build(); |
||
42 | } |
||
44 |