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

RuleTransformFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A build() 0 3 1
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
}