Total Complexity | 8 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class PheanstalkLocator |
||
8 | { |
||
9 | /** |
||
10 | * @var PheanstalkInterface[] |
||
11 | */ |
||
12 | private $pheanstalks; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $default; |
||
18 | |||
19 | /** |
||
20 | * Constructor. |
||
21 | */ |
||
22 | 5 | public function __construct() |
|
23 | { |
||
24 | 5 | $this->pheanstalks = []; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return PheanstalkInterface[] |
||
29 | */ |
||
30 | 4 | public function getPheanstalks() |
|
31 | { |
||
32 | 4 | return $this->pheanstalks; |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param string $name |
||
37 | * |
||
38 | * @return PheanstalkInterface |
||
39 | */ |
||
40 | 4 | public function getPheanstalk($name = null) |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return array |
||
53 | */ |
||
54 | 3 | public function getDefaultPheanstalk() |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param string $name |
||
61 | * @param PheanstalkInterface $pheanstalk |
||
62 | * @param bool $default |
||
63 | */ |
||
64 | 4 | public function addPheanstalk($name, PheanstalkInterface $pheanstalk, bool $default = false) |
|
74 |