PipelineBuilder   A
last analyzed

↳ Parent: Project

Coupling/Cohesion

Components 1
Dependencies 1

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 6 1
A build() 0 4 1
1
<?php
2
3
namespace League\Pipeline;
4
5
class PipelineBuilder implements PipelineBuilderInterface
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
     * Build a new Pipeline object
28
     *
29
     * @param  ProcessorInterface|null $processor
30
     *
31
     * @return PipelineInterface
32
     */
33 4
    public function build(ProcessorInterface $processor = null)
34
    {
35 4
        return new Pipeline($this->stages, $processor);
36
    }
37
}
38