@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | class DiceApp extends App |
| 16 | 16 | { |
| 17 | 17 | const DICE_PATH_REGEX = "{dice:(?:/[0-9]*[dD][^\/]+)+/?}"; |
| 18 | - private const INDEX_FILE_PATH = __DIR__ . "/generated-index.html"; |
|
| 18 | + private const INDEX_FILE_PATH = __DIR__."/generated-index.html"; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @var DiceCounter |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $this->diceCounter = $diceCounter; |
| 36 | 36 | |
| 37 | 37 | $this->setupRoutes(); |
| 38 | - $this->tip = function (){ |
|
| 38 | + $this->tip = function() { |
|
| 39 | 39 | |
| 40 | 40 | }; |
| 41 | 41 | } |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | public static function buildIndex(): string |
| 48 | 48 | { |
| 49 | 49 | $converter = new CommonMarkConverter(); |
| 50 | - $indexBody = $converter->convertToHtml(file_contents(__DIR__ . "/../README.md")); |
|
| 51 | - $indexContent = file_contents(__DIR__ . "/../www/templates/index.html"); |
|
| 50 | + $indexBody = $converter->convertToHtml(file_contents(__DIR__."/../README.md")); |
|
| 51 | + $indexContent = file_contents(__DIR__."/../www/templates/index.html"); |
|
| 52 | 52 | $indexContent = str_replace("{{body}}", $indexBody, $indexContent); |
| 53 | 53 | file_put_contents(self::INDEX_FILE_PATH, $indexContent); |
| 54 | 54 | return $indexContent; |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $diceRequestHandler = $this->diceRequestHandler; |
| 97 | 97 | $this->get( |
| 98 | - "/{$path}" . self::DICE_PATH_REGEX, |
|
| 99 | - function (Request $request, Response $response, $args) use ($diceRequestHandler, $contentType): Response { |
|
| 98 | + "/{$path}".self::DICE_PATH_REGEX, |
|
| 99 | + function(Request $request, Response $response, $args) use ($diceRequestHandler, $contentType): Response { |
|
| 100 | 100 | return $diceRequestHandler->getDice( |
| 101 | 101 | $request->withHeader('accept', $contentType), |
| 102 | 102 | $response, |