Completed
Push — master ( 90448b...2ebf44 )
by Vladimir
05:45 queued 30s
created

Check::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 5
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\rabbitmq\RabbitMQ;
13
14
use JMS\Serializer\Annotation as JMS;
15
use ZendDiagnostics\Check\RabbitMQ;
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 RabbitMQ
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 $host
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
32
     * @param int    $port
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
33
     * @param string $user
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
34
     * @param string $password
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
35
     * @param string $vhost
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
36
     */
37 2
    public function __construct(
38
        $host = 'localhost',
39
        $port = 5672,
40
        $user = 'guest',
41
        $password = 'guest',
42
        $vhost = '/')
0 ignored issues
show
Coding Style introduced by
The closing parenthesis of a multi-line function declaration must be on a new line
Loading history...
43
    {
0 ignored issues
show
Coding Style introduced by
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Loading history...
44 2
        $this->checker = new RabbitMQ($host,
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
45 2
            $port,
46 2
            $user,
47 2
            $password,
48 2
            $vhost);
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 8 spaces, but found 12.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
49 2
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
54 2
    public function check()
55
    {
56 2
        return $this->checker->check();
57
    }
58
}
59