PassthruTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Incoming
4
 *
5
 * @author    Trevor Suarez (Rican7)
6
 * @copyright (c) Trevor Suarez
7
 * @link      https://github.com/Rican7/incoming
8
 * @license   MIT
9
 */
10
11
declare(strict_types=1);
12
13
namespace Incoming\Transformer;
14
15
/**
16
 * A transformer that simply returns the input data as is.
17
 *
18
 * Great for use as part of the "Null Object" pattern as its basically a no-op.
19
 */
20
class PassthruTransformer implements Transformer
21
{
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @param mixed $input The data to transform.
27
     * @return mixed The original input data, without transformation.
28
     */
29 3
    public function transform($input)
30
    {
31 3
        return $input;
32
    }
33
}
34