Completed
Push — master ( 610136...82575c )
by De Cramer
06:15 queued 03:00
created

AbstractChainOperation::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 9
ccs 0
cts 7
cp 0
crap 6
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace Oliverde8\Component\PhpEtl\ChainOperation;
4
use Oliverde8\Component\PhpEtl\Item\ItemInterface;
5
6
/**
7
 * Class AbstractChainOperation
8
 *
9
 * @author    de Cramer Oliver<[email protected]>
10
 * @copyright 2018 Oliverde8
11
 * @package Oliverde8\Component\PhpEtl\ChainOperation
12
 */
13
class AbstractChainOperation implements ChainOperationInterface
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public function process(ItemInterface $item, array &$context): ItemInterface
19
    {
20
        $method = 'process' . ucfirst($item->getMethod());
21
22
        if (method_exists($this, $method)) {
23
            return $this->$method($item, $context);
24
        }
25
26
        return $item;
27
    }
28
}