AbstractTransformation::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Cerbero\Transformer\Transformations;
4
5
/**
6
 * The abstract transformation.
7
 *
8
 */
9
abstract class AbstractTransformation
10
{
11
    /**
12
     * The value to transform.
13
     *
14
     * @var mixed
15
     */
16
    protected $value;
17
18
    /**
19
     * The item containing the value to transform.
20
     *
21
     * @var array|object
22
     */
23
    protected $item;
24
25
    /**
26
     * Set the dependencies.
27
     *
28
     * @param mixed $value
29
     * @param array|object $item
30
     */
31 51
    public function __construct($value, $item)
32
    {
33 51
        $this->value = $value;
34 51
        $this->item = $item;
35 51
    }
36
37
    /**
38
     * Apply the transformation
39
     *
40
     * @param array $parameters
41
     * @return void
42
     */
43
    abstract public function apply(array $parameters);
44
}
45