Total Complexity | 5 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class LoopFactory implements ILoopFactory |
||
13 | { |
||
14 | private static ?ILoop $loop = null; |
||
15 | |||
16 | public function __construct( |
||
19 | } |
||
20 | |||
21 | public function getLoop(): ILoop |
||
22 | { |
||
23 | if (self::$loop === null) { |
||
24 | self::$loop = $this->createLoop(); |
||
25 | } |
||
26 | return self::$loop; |
||
|
|||
27 | } |
||
28 | |||
29 | private function createLoop(): ILoop |
||
30 | { |
||
31 | return $this->getLoopProbe()->createLoop(); |
||
32 | } |
||
33 | |||
34 | private function getLoopProbe(): ILoopProbe |
||
37 | } |
||
38 | } |
||
39 |