Completed
Push — master ( e60e0a...93839a )
by Thibaud
02:26
created

NestedPipelineElement::execute()   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 1
Metric Value
c 1
b 0
f 1
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
/*
4
 * This file is part of alchemy/pipeline-component.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Alchemy\Pipeline\Element;
13
14
use Alchemy\Pipeline\Pipeline;
15
use Alchemy\Pipeline\PipelineElement;
16
use Alchemy\Resource\Resource;
17
18
class NestedPipelineElement implements PipelineElement
19
{
20
    /**
21
     * @var Pipeline
22
     */
23
    private $pipeline;
24
25
    /**
26
     * @param Pipeline $pipeline
27
     */
28 4
    public function __construct(Pipeline $pipeline)
29
    {
30 4
        $this->pipeline = $pipeline;
31 4
    }
32
33
    /**
34
     * @param \Alchemy\Resource\Resource $resource
35
     * @return \Alchemy\Resource\Resource
36
     */
37 4
    public function execute(Resource $resource)
38
    {
39 4
        return $this->pipeline->process($resource);
40
    }
41
}
42