| Conditions | 6 |
| Paths | 5 |
| Total Lines | 25 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 12.7161 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 1 | public function performAction() |
|
| 29 | { |
||
| 30 | $this->prePerform(); |
||
| 31 | if (null === $this->diff) { |
||
| 32 | 1 | return; |
|
| 33 | } |
||
| 34 | 1 | ||
| 35 | 1 | if ($this->merge) { |
|
| 36 | $this->out = $this->diff->getMergePatch(); |
||
| 37 | } else { |
||
| 38 | $this->out = $this->diff->getPatch(); |
||
| 39 | $outJson = $this->out->jsonSerialize(); |
||
| 40 | if ($this->prettyShort && !empty($outJson)) { |
||
| 41 | $out = '['; |
||
| 42 | foreach ($outJson as $item) { |
||
| 43 | $out .= "\n " . json_encode($item, JSON_UNESCAPED_SLASHES) . ','; |
||
| 44 | } |
||
| 45 | $out = substr($out, 0, -1); |
||
| 46 | 1 | $out .= "\n]"; |
|
| 47 | 1 | $this->response->addContent($out); |
|
| 48 | return; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | $this->postPerform(); |
||
| 53 | } |
||
| 54 | } |