Completed
Pull Request — develop (#3)
by
unknown
07:53
created

TransformDefault::apply()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php namespace Cerbero\Transformer\Transformations;
2
3
/**
4
 * Transform a value to a string.
5
 *
6
 * @author	Andrea Marco Sartori
7
 */
8
class TransformDefault extends AbstractTransformation
9
{
10
    /**
11
     * Apply the transformation.
12
     *
13
     * @author	Andrea Marco Sartori
14
     * @param	array	$params
15
     * @return	string
16
     */
17
    public function apply(array $params)
18
    {
19
        return empty($this->value) ? $params[0] : $this->value;
20
    }
21
}
22