Completed
Pull Request — master (#1)
by De Cramer
02:11
created

RuleTransformFactory::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Oliverde8\Component\PhpEtl\Builder\Factories\Transformer;
4
5
use Oliverde8\Component\PhpEtl\Builder\Factories\AbstractFactory;
6
use Oliverde8\Component\RuleEngine\RuleApplier;
7
8
/**
9
 * Class RuleTransformFactory
10
 *
11
 * @author    de Cramer Oliver<[email protected]>
12
 * @copyright 2018 Oliverde8
13
 * @package Oliverde8\Component\PhpEtl\Builder\Factories\Transformer
14
 */
15
class RuleTransformFactory extends AbstractFactory
16
{
17
    /** @var RuleApplier */
18
    protected $ruleApplier;
19
20
    /**
21
     * RuleTransformFactory constructor.
22
     *
23
     * @param string $operation
24
     * @param string $class
25
     * @param RuleApplier $ruleApplier
26
     */
27
    public function __construct($operation, $class, RuleApplier $ruleApplier)
28
    {
29
        parent::__construct($operation, $class);
30
31
        $this->ruleApplier = $ruleApplier;
32
    }
33
34
35
    /**
36
     * @inheritdoc
37
     */
38
    public function build($operation, $options)
39
    {
40
        return $this->create($this->ruleApplier, $options['columns'], $options['add']);
0 ignored issues
show
Bug introduced by
$this->ruleApplier of type Oliverde8\Component\RuleEngine\RuleApplier is incompatible with the type array expected by parameter $arguments of Oliverde8\Component\PhpE...stractFactory::create(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

40
        return $this->create(/** @scrutinizer ignore-type */ $this->ruleApplier, $options['columns'], $options['add']);
Loading history...
41
    }
42
}