ConfigOptions   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 1
b 0
f 0
dl 0
loc 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A call() 0 18 4
1
<?php
2
namespace Health\Checks\Php;
3
4
use Health\Checks\BaseCheck;
5
use Health\Checks\HealthCheckInterface;
6
7
class ConfigOptions extends BaseCheck implements HealthCheckInterface
8
{
9
10
    /**
11
     *
12
     * {@inheritdoc}
13
     * @see \Health\Checks\HealthCheckInterface::call()
14
     */
15
    public function call()
16
    {
17
        $builder = $this->getBuilder();
18
19
        $options = $this->getParam('options', []);
20
        $errors = [];
21
22
        foreach ($options as $option => $value) {
23
            if (ini_get($option) != $value) {
24
                $errors[] = $option;
25
            }
26
        }
27
28
        if ($errors) {
29
            $builder->down()->withData('errors', $errors);
30
        }
31
32
        return $builder->build();
33
    }
34
}
35