| Total Complexity | 6 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Prefix implements ReflectionTransformerInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $prefix; |
||
| 15 | /** |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | private $replace; |
||
| 19 | |||
| 20 | 9 | public function __construct(string $prefix, array $replace) |
|
| 24 | 9 | } |
|
| 25 | |||
| 26 | 6 | public function transform(string $name, array $params): array |
|
| 27 | { |
||
| 28 | 6 | if (strpos($name, $this->prefix) === 0) { |
|
| 29 | 3 | $params = $this->transformParam($params); |
|
| 30 | } |
||
| 31 | 6 | return $params; |
|
| 32 | } |
||
| 33 | |||
| 34 | 3 | private function transformParam(array $params): array |
|
| 42 | } |
||
| 43 | } |
||
| 44 |