| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 2 | public function scope(string $filePath, string $prefix): string |
|
| 34 | { |
||
| 35 | 2 | if (1 !== preg_match('/composer\.json$/', $filePath)) { |
|
| 36 | 1 | return $this->decoratedScoper->scope($filePath, $prefix); |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | $decodedJson = json_decode( |
|
| 40 | file_get_contents($filePath), |
||
| 41 | 1 | true |
|
| 42 | ); |
||
| 43 | |||
| 44 | 1 | $decodedJson = AutoloadPrefixer::prefixPackageAutoloads($decodedJson, $prefix); |
|
| 45 | |||
| 46 | 1 | return json_encode( |
|
| 47 | $decodedJson, |
||
| 48 | 1 | JSON_PRETTY_PRINT |
|
| 49 | ); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |