Completed
Push — master ( 297732...0f69fa )
by Frank
03:26
created

PipelineBuilder::build()   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 0
crap 1
1
<?php
2
3
namespace League\Pipeline;
4
5
class PipelineBuilder
6
{
7
    /**
8
     * @var callable[]
9
     */
10
    private $stages = [];
11
12
    /**
13
     * Add an stage.
14
     *
15
     * @param callable $stage
16
     *
17
     * @return $this
18
     */
19 4
    public function add(callable $stage)
20
    {
21 4
        $this->stages[] = $stage;
22
23 4
        return $this;
24
    }
25
26
    /**
27
     * @return Pipeline
28
     */
29 4
    public function build()
30
    {
31 4
        return new Pipeline($this->stages);
32
    }
33
}
34