Passed
Push — master ( 823aee...b9b37f )
by Alec
13:15 queued 12s
created

ReactLoopProbe::createLoop()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
// 17.02.23
5
6
namespace AlecRabbit\Spinner\Asynchronous\Loop\Probe;
7
8
use AlecRabbit\Spinner\Asynchronous\Loop\Adapter\ReactLoopAdapter;
9
use AlecRabbit\Spinner\Asynchronous\Loop\Probe\A\ALoopProbe;
10
use AlecRabbit\Spinner\Core\Contract\ILoopAdapter;
11
use React\EventLoop\Loop;
12
13
use function class_exists;
14
15
class ReactLoopProbe extends ALoopProbe
16
{
17
    public static function isSupported(): bool
18
    {
19
        return class_exists(Loop::class);
20
    }
21
22
    public static function createLoop(): ILoopAdapter
23
    {
24
        return new ReactLoopAdapter(Loop::get());
25
    }
26
}
27