PassthruTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

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