Passed
Push — master ( 505a98...965270 )
by Vladimir
07:00
created

Plugin::_check()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 23
ccs 18
cts 18
cp 1
rs 9.6333
c 0
b 0
f 0
cc 1
nc 1
nop 1
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\QueueSize;
13
14
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
15
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
16
use Tvi\MonitorBundle\Check\CheckPluginAbstract;
17
18
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
19
 * @author Vladimir Turnaev <[email protected]>
20
 */
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...
21
class Plugin extends CheckPluginAbstract
22
{
23
    const DESCR =
0 ignored issues
show
Coding Style introduced by
Multi-line assignments must have the equal sign on the second line
Loading history...
24
<<<'TXT'
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 0
Loading history...
25
rabbit_mq description
26
TXT;
27
28
    const PATH = __DIR__;
29
30
    const GROUP = 'rabbit_mq';
31
    const CHECK_NAME = 'core:rabbit_mq:queue_size';
32
33
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
34
     * @param NodeDefinition|ArrayNodeDefinition $node
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
35
     *
36
     * @return NodeDefinition|ArrayNodeDefinition
37
     */
38 56
    protected function _check(NodeDefinition $node): NodeDefinition
0 ignored issues
show
Coding Style introduced by
Protected method name "Plugin::_check" must not be prefixed with an underscore
Loading history...
39
    {
40
        $node = $node
41 56
            ->children()
42 56
                ->arrayNode('check')
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
43 56
                    ->beforeNormalization()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 20
Loading history...
44 56
                        ->ifString()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 24
Loading history...
45
                        ->then(static function ($v) { return ['dsn' => $v]; })
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 24
Loading history...
Coding Style introduced by
Opening brace must be the last content on the line
Loading history...
Coding Style introduced by
Closing brace must be on a line by itself
Loading history...
46 56
                    ->end()
47 56
                    ->children()
48 56
                        ->scalarNode('host')->defaultValue('localhost')->end()
49 56
                        ->integerNode('port')->defaultValue(5672)->end()
50 56
                        ->scalarNode('user')->defaultValue('guest')->end()
51 56
                        ->scalarNode('password')->defaultValue('guest')->end()
52 56
                        ->scalarNode('vhost')->defaultValue('/')->end()
53 56
                        ->scalarNode('dsn')->defaultNull()->end()
54 56
                    ->end()
55 56
                ->end()
56 56
            ->end();
57
58 56
        $this->_addition($node);
59
60 56
        return $node;
61
    }
62
}
63