Passed
Push — master ( e0f7b0...4354d2 )
by Vladimir
05:39 queued 20s
created

Check   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 14
rs 10
c 0
b 0
f 0
ccs 4
cts 5
cp 0.8
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 7 2
1
<?php
2
/**
3
 * This file is part of the `tvi/monitor-bundle` project.
4
 *
5
 * (c) https://github.com/turnaev/monitor-bundle/graphs/contributors
6
 *
7
 * For the full copyright and license information, please view the LICENSE.md
8
 * file that was distributed with this source code.
9
 */
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...
10
11
namespace Tvi\MonitorBundle\Check\php\ExtensionNotLoaded;
12
13
use ZendDiagnostics\Result\Failure;
14
use ZendDiagnostics\Result\Success;
15
16
use Tvi\MonitorBundle\Check\CheckInterface;
17
use Tvi\MonitorBundle\Check\CheckTrait;
18
19
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
20
 * @author Vladimir Turnaev <[email protected]>
21
 */
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...
22
class Check extends \ZendDiagnostics\Check\ExtensionLoaded implements CheckInterface
23
{
24
    use CheckTrait;
25
26
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
27
     * @return Failure|\ZendDiagnostics\Result\ResultInterface|Success
28
     */
29 2
    public function check()
30
    {
31 2
        $r = parent::check();
32 2
        if($r instanceof Success) {
0 ignored issues
show
Coding Style introduced by
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
33 2
            return new Failure($r->getMessage(), $r->getData());
34
        } else {
35
            return new Success($r->getMessage(), $r->getData());
36
        }
37
    }
38
}
39