Check   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A check() 0 3 1
A __construct() 0 3 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\fs\DiskUsage;
13
14
use JMS\Serializer\Annotation as JMS;
15
use ZendDiagnostics\Check\DiskUsage;
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 DiskUsage
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 int    $warningThreshold  A number between 0 and 100
32
     * @param int    $criticalThreshold A number between 0 and 100
33
     * @param string $path              The disk path to check, i.e. '/tmp' or 'C:' (defaults to /)
34
     *
35
     * @throws InvalidArgumentException
36
     */
37 2
    public function __construct($warningThreshold, $criticalThreshold, $path = '/')
38
    {
39 2
        $this->checker = new DiskUsage($warningThreshold, $criticalThreshold, $path);
40 2
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
45 2
    public function check()
46
    {
47 2
        return $this->checker->check();
48
    }
49
}
50