AbstractTransformation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 35
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 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