| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function __invoke(string $filePath, string $prefix, string $contents): string |
||
| 29 | 21 | { |
|
| 30 | 9 | if (!self::isSupportedFile($filePath)) { |
|
| 31 | return $contents; |
||
| 32 | } |
||
| 33 | 12 | ||
| 34 | 12 | return (string) preg_replace( |
|
| 35 | 12 | '/use (Symfony(\\\\(?:\\\\)?)Component\\\\.+?;)/', |
|
| 36 | 12 | sprintf( |
|
| 37 | 12 | 'use %s$2$1', |
|
| 38 | $prefix |
||
| 39 | 12 | ), |
|
| 40 | $contents |
||
| 41 | ); |
||
| 55 |