Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
27 | 21 | public function __invoke(string $filePath, string $prefix, string $contents): string |
|
28 | { |
||
29 | 21 | if (false === $this->isValidPath($filePath)) { |
|
30 | 9 | return $contents; |
|
31 | } |
||
32 | |||
33 | 12 | return preg_replace( |
|
34 | 12 | '/use (Symfony(\\\\(?:\\\\)?)Component\\\\.+?;)/', |
|
35 | 12 | sprintf( |
|
36 | 12 | 'use %s$2$1', |
|
37 | 12 | $prefix |
|
38 | ), |
||
39 | 12 | $contents |
|
40 | ); |
||
41 | } |
||
42 | |||
54 |