Completed
Push — master ( aca6e3...e7aa24 )
by Vladimir
05:21
created

RunnerManager::findChecks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 3
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\Runner;
13
14
use Tvi\MonitorBundle\Check\CheckInterface;
15
use Tvi\MonitorBundle\Check\Group;
16
use Tvi\MonitorBundle\Check\CheckManager;
17
use Tvi\MonitorBundle\Check\Tag;
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 RunnerManager
23
{
24
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
25
     * @var CheckManager
26
     */
27
    protected $checkManager;
28
29 3
    public function __construct(CheckManager $checkManager)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
30
    {
31 3
        $this->checkManager = $checkManager;
32 3
    }
33
34
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
35
     * @param ?string|string[] $alias
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
36
     * @param ?string|string[] $groups
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
37
     * @param ?string|string[] $tags
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
38
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
39 1
    public function getRunner($alias = null, $groups = null, $tags = null): Runner
40
    {
41 1
        $checks = $this->checkManager->findChecks($alias, $groups, $tags);
42
43 1
        return new Runner(null, $checks);
44
    }
45
46
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
47
     * @param ?string|string[] $alias
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
48
     * @param ?string|string[] $groups
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
49
     * @param ?string|string[] $tags
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
50
     *
51
     * @return CheckInterface[]
52
     */
53 1
    public function findChecks($alias = null, $groups = null, $tags = null): array
54
    {
55 1
        return $this->checkManager->findChecks($alias, $groups, $tags);
56
    }
57
58
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
59
     * @param ?string|string[] $tags
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
60
     *
61
     * @return Tag[]
62
     */
63 1
    public function findTags($tags = null): array
64
    {
65 1
        return $this->checkManager->findTags($tags);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->checkManager->findTags($tags) returns an array which contains values of type Tvi\MonitorBundle\Check\Group which are incompatible with the documented value type Tvi\MonitorBundle\Check\Tag.
Loading history...
66
    }
67
68
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
69
     * @param ?string|string[] $groups
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
70
     *
71
     * @return Group[]
72
     */
73 1
    public function findGroups($groups = null): array
74
    {
75 1
        return $this->checkManager->findGroups($groups);
76
    }
77
}
78