Passed
Push — master ( 8b92f8...a05608 )
by Bartosz
33s
created

LoopFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 25
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * File: LoopFactory.php
7
 *
8
 * @author Bartosz Kubicki [email protected]>
9
 * @copyright Copyright (C) 2018 Lizard Media (http://lizardmedia.pl)
10
 */
11
12
namespace LizardMedia\AdminIndexer\Model\Adapter\ReactPHP\EventLoop;
13
14
use LizardMedia\AdminIndexer\Api\Adapter\ReactPHP\EventLoop\LoopFactoryInterface;
15
use React\EventLoop\LoopInterface;
16
use React\EventLoop\Factory;
17
18
/**
19
 * Class LoopFactory
20
 * @package LizardMedia\AdminIndexer\Model\Adapter\ReactPHP\EventLoop
21
 */
22
class LoopFactory implements LoopFactoryInterface
23
{
24
    /**
25
     * @var Factory
26
     */
27
    private $factory;
28
29
    /**
30
     * LoopFactory constructor.
31
     * @param Factory $factory
32
     */
33
    public function __construct(
34
        Factory $factory
35
    ) {
36
        $this->factory = $factory;
37
    }
38
39
    /**
40
     * @return LoopInterface
41
     */
42
    public function create(): LoopInterface
43
    {
44
        return $this->factory->create();
45
    }
46
}