| Conditions | 4 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function handleConflict(IndexObject $remoteObject, IndexObject $localObject = null, IndexObject $lastLocalObject = null): int |
||
| 28 | { |
||
| 29 | $text = <<<TXT |
||
| 30 | <question>Encountered conflict at {$remoteObject->getRelativePath()}</question> |
||
| 31 | TXT; |
||
| 32 | |||
| 33 | $this->consoleStyle->writeln($text); |
||
| 34 | |||
| 35 | $return = null; |
||
| 36 | do |
||
| 37 | { |
||
| 38 | $choice = $this->consoleStyle->choice('Would you like to use the local (l) or the remote (r) version?', ['l', 'r']); |
||
| 39 | |||
| 40 | switch ($choice) |
||
| 41 | { |
||
| 42 | case 'l': $return = ConflictHandlerInterface::USE_LOCAL; break 2; |
||
| 43 | case 'r': $return = ConflictHandlerInterface::USE_REMOTE; break 2; |
||
| 44 | } |
||
| 45 | |||
| 46 | $this->consoleStyle->warning("Invalid choice"); |
||
| 47 | } |
||
| 48 | while(true); |
||
| 49 | |||
| 50 | return $return; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.