| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class CollisionHandler implements CollisionHandlerInterface |
||
| 9 | { |
||
| 10 | public function __construct(Path $pathUtil = null) |
||
| 11 | { |
||
| 12 | $this->pathUtil = $pathUtil ?: new Path; |
||
|
|
|||
| 13 | } |
||
| 14 | |||
| 15 | /** |
||
| 16 | * {@inheritdoc} |
||
| 17 | */ |
||
| 18 | public function handle($targetFile, $newContent, array $parameters = null) |
||
| 19 | { |
||
| 20 | switch ($this->pathUtil->getExtension($targetFile)) { |
||
| 21 | case 'json': |
||
| 22 | $this->mergeJson($targetFile, $newContent); |
||
| 23 | |||
| 24 | break; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | protected function mergeJson($targetFile, $newContent) |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |