Test Failed
Push — master ( f50264...02e3d1 )
by Vladimir
05:15
created

CheckPluginFinderPath::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
c 0
b 0
f 0
rs 10
cc 2
nc 2
nop 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;
13
14
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
15
 * @author Vladimir Turnaev <[email protected]>
16
 */
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...
17
class CheckPluginFinderPath
18
{
19
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
20
     * @var string
21
     */
22
    protected $basePath;
23
24
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
25
     * @var string[]
26
     */
27
    protected $paths = [];
28
29
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $basePath should have a doc-comment as per coding-style.
Loading history...
30
     * @param string|string[] $path
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Doc comment for parameter $path does not match actual variable name $basePath
Loading history...
31
     */
32
    public function __construct(string $basePath, $path)
33
    {
34
        $basePath = \rtrim($basePath, \DIRECTORY_SEPARATOR);
35
        $this->basePath = $basePath;
36
        $this->paths = \is_string($path) ? [$path] : $path;
37
    }
38
39
    public function getPathes()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function getPathes()
Loading history...
40
    {
41
        return array_map(
42
            function ($i) {
43
                return sprintf('%s%s%s', $this->basePath, \DIRECTORY_SEPARATOR, $i);
44
            },
45
            $this->paths);
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...
46
    }
47
}
48