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

PipelineBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 1 Features 0
Metric Value
wmc 2
c 6
b 1
f 0
lcom 1
cbo 1
dl 0
loc 29
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 4 1
A add() 0 6 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