DefaultTransformation::apply()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Cerbero\Transformer\Transformations;
4
5
/**
6
 * Transform a missing value.
7
 *
8
 */
9
class DefaultTransformation extends AbstractTransformation
10
{
11
    /**
12
     * Apply the transformation
13
     *
14
     * @param array $parameters
15
     * @return mixed
16
     */
17 27
    public function apply(array $parameters)
18
    {
19 27
        return $this->value === null ? $parameters[0] : $this->value;
20
    }
21
}
22