Check::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * This file is part of the `tvi/monitor-bundle` project.
5
 *
6
 * (c) https://github.com/turnaev/monitor-bundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @author tag in file comment
Loading history...
Coding Style introduced by
Missing @license tag in file comment
Loading history...
Coding Style introduced by
Missing @link tag in file comment
Loading history...
11
12
namespace Tvi\MonitorBundle\Check\php\PhpFlag;
13
14
use JMS\Serializer\Annotation as JMS;
15
use ZendDiagnostics\Check\PhpFlag;
16
use Tvi\MonitorBundle\Check\CheckAbstract;
17
18
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
19
 * @JMS\ExclusionPolicy("all")
20
 *
21
 * @author Vladimir Turnaev <[email protected]>
22
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
23
class Check extends CheckAbstract
24
{
25
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
26
     * @var PhpFlag
27
     */
28
    private $checker;
0 ignored issues
show
Coding Style introduced by
Private member variable "checker" must be prefixed with an underscore
Loading history...
29
30
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
31
     * @param string|array|\traversable $settingName   PHP setting names to check
32
     * @param bool                      $expectedValue true or false
33
     *
34
     * @throws \InvalidArgumentException
35
     */
36 2
    public function __construct($settingName, $expectedValue)
37
    {
38 2
        $this->checker = new PhpFlag($settingName, $expectedValue);
39 2
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
44 2
    public function check()
45
    {
46 2
        return $this->checker->check();
47
    }
48
}
49