Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 4 | public function transform($input, array $arguments) |
|
37 | { |
||
38 | // I should have two arguments: old format / new format |
||
39 | 4 | if (count($arguments) !== 1 && count($arguments) !== 2) { |
|
40 | 2 | throw new TransformationException('Rule Concat Expects 1 or 2 argument(s)'); |
|
41 | } |
||
42 | 2 | $before = $arguments[0]; |
|
43 | 2 | $after = (array_key_exists(1, $arguments) ? $arguments[1] : ''); |
|
44 | |||
45 | 2 | return $before.$input.$after; |
|
46 | } |
||
47 | } |
||
48 |