Completed
Pull Request — master (#94)
by Alessandro
04:33
created

PipelineFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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