@@ -96,6 +96,9 @@ |
||
| 96 | 96 | return $newDice; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | + /** |
|
| 100 | + * @param string $_type |
|
| 101 | + */ |
|
| 99 | 102 | private function buildSteveDice($_type, $diceCount) |
| 100 | 103 | { |
| 101 | 104 | $newDice = []; |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function index(Request $request, Response $response) |
| 29 | 29 | { |
| 30 | - $indexFilePath = __DIR__ . "/generated-index.html"; |
|
| 30 | + $indexFilePath = __DIR__."/generated-index.html"; |
|
| 31 | 31 | if (!file_exists($indexFilePath)) { |
| 32 | 32 | $converter = new CommonMarkConverter(); |
| 33 | - $indexBody = $converter->convertToHtml(file_get_contents(__DIR__ . "/../README.md")); |
|
| 34 | - $indexContent = file_get_contents(__DIR__ . "/../www/templates/index.html"); |
|
| 33 | + $indexBody = $converter->convertToHtml(file_get_contents(__DIR__."/../README.md")); |
|
| 34 | + $indexContent = file_get_contents(__DIR__."/../www/templates/index.html"); |
|
| 35 | 35 | $indexContent = str_replace("{{body}}", $indexBody, $indexContent); |
| 36 | 36 | file_put_contents($indexFilePath, $indexContent); |
| 37 | 37 | $response->write($indexContent); |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | $this->get(self::DICE_PATH_REGEX, [$diceRequestHandler, 'getDice']); |
| 59 | 59 | |
| 60 | 60 | $this->get( |
| 61 | - "/html" . self::DICE_PATH_REGEX, |
|
| 62 | - function (Request $request, $response, $args) use ($diceRequestHandler) { |
|
| 61 | + "/html".self::DICE_PATH_REGEX, |
|
| 62 | + function(Request $request, $response, $args) use ($diceRequestHandler) { |
|
| 63 | 63 | return $diceRequestHandler->getDice( |
| 64 | 64 | $request->withHeader('accept', 'text/html'), |
| 65 | 65 | $response, |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | ); |
| 70 | 70 | $this->get( |
| 71 | - "/json" . self::DICE_PATH_REGEX, |
|
| 72 | - function (Request $request, $response, $args) use ($diceRequestHandler) { |
|
| 71 | + "/json".self::DICE_PATH_REGEX, |
|
| 72 | + function(Request $request, $response, $args) use ($diceRequestHandler) { |
|
| 73 | 73 | return $diceRequestHandler->getDice( |
| 74 | 74 | $request->withHeader('accept', 'application/json'), |
| 75 | 75 | $response, |