Plugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 28
dl 0
loc 39
ccs 21
cts 21
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A _check() 0 27 2
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\JsonFile;
13
14
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
15
use Tvi\MonitorBundle\Check\CheckPluginAbstract;
16
17
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
18
 * @author Vladimir Turnaev <[email protected]>
19
 */
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...
20
class Plugin extends CheckPluginAbstract
21
{
22
    const DESCR =
0 ignored issues
show
Coding Style introduced by
Multi-line assignments must have the equal sign on the second line
Loading history...
23
<<<'TXT'
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 0
Loading history...
24
json_file description
25
TXT;
26
27
    const PATH = __DIR__;
28
29
    const GROUP = 'fs';
30
    const CHECK_NAME = 'core:json_file';
31
32 57
    protected function _check(ArrayNodeDefinition $node): ArrayNodeDefinition
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function _check()
Loading history...
Coding Style introduced by
Protected method name "Plugin::_check" must not be prefixed with an underscore
Loading history...
33
    {
34
        $node = $node
35 57
            ->children()
36 57
                ->arrayNode('check')
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
37 57
                    ->children()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 20
Loading history...
38 57
                        ->arrayNode('files')
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 24
Loading history...
39 57
                            ->isRequired()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 28
Loading history...
40 57
                            ->beforeNormalization()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 28
Loading history...
41 57
                                ->ifString()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 32
Loading history...
42 57
                                ->then(static function ($value) {
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 32
Loading history...
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
43 1
                                    if (\is_string($value)) {
44 1
                                        $value = [$value];
45
                                    }
46
47 1
                                    return $value;
48 57
                                })
0 ignored issues
show
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 57
                                ->end()
50 57
                            ->prototype('scalar')->end()
0 ignored issues
show
Bug introduced by
The method prototype() does not exist on Symfony\Component\Config...\Builder\NodeDefinition. It seems like you code against a sub-type of Symfony\Component\Config...\Builder\NodeDefinition such as Symfony\Component\Config...der\ArrayNodeDefinition. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

50
                            ->/** @scrutinizer ignore-call */ prototype('scalar')->end()
Loading history...
51 57
                        ->end()
52 57
                    ->end()
53 57
                ->end()
54 57
            ->end();
55
56 57
        $this->_addition($node);
57
58 57
        return $node;
59
    }
60
}
61