PipelineFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Paraunit\Runner;
6
7
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
8
9
/**
10
 * Class PipelineFactory
11
 * @package Paraunit\Runner
12
 */
13
class PipelineFactory
14
{
15
    /** @var EventDispatcherInterface */
16
    private $dispatcher;
17
18 41
    public function __construct(EventDispatcherInterface $dispatcher)
19
    {
20 41
        $this->dispatcher = $dispatcher;
21
    }
22
23
    /**
24
     * @param int $pipelineNumber
25
     * @return Pipeline
26
     */
27 41
    public function create(int $pipelineNumber): Pipeline
28
    {
29 41
        return new Pipeline($this->dispatcher, $pipelineNumber);
30
    }
31
}
32