| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 4.074 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 41 | 4 | public function export(array $assetBundles): void |
|
| 42 | { |
||
| 43 | 4 | $targetDirectory = dirname($this->targetFile); |
|
| 44 | |||
| 45 | 4 | if (!is_dir($targetDirectory) || !is_writable($targetDirectory)) { |
|
| 46 | 1 | throw new RuntimeException("Target directory \"{$targetDirectory}\" does not exist or is not writable."); |
|
| 47 | } |
||
| 48 | |||
| 49 | 3 | if (file_put_contents($this->targetFile, Json::encode($assetBundles), LOCK_EX) === false) { |
|
| 50 | throw new RuntimeException("An error occurred while writing to the \"{$this->targetFile}\" file."); |
||
| 51 | } |
||
| 54 |