Completed
Push — master ( 279232...aa48a7 )
by Steve
01:35
created
src/Renderer/Protobuf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
     private function diceAsProtos(array $diceCollection)
36 36
     {
37
-        return array_map(function (Dice $dice) : DiceProtobuf {
37
+        return array_map(function(Dice $dice) : DiceProtobuf {
38 38
             $proto = new DiceProtobuf();
39 39
             $proto->setValue($dice->roll());
40 40
             $proto->setName($dice->name());
Please login to merge, or discard this patch.
src/Dice/BasicDice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
     public function roll(): int
26 26
     {
27
-        if (! function_exists('random_int')) {
27
+        if (!function_exists('random_int')) {
28 28
             return mt_rand(1, $this->size);
29 29
         }
30 30
 
Please login to merge, or discard this patch.
src/Dice/Factories/SpecialDiceFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
     public function __construct()
15 15
     {
16 16
         $this->diceTypeMappings = [
17
-            'steve' => function (): Dice\SteveDice {
17
+            'steve' => function(): Dice\SteveDice {
18 18
                 return new Dice\SteveDice();
19 19
             },
20
-            'fate'  => function (): Dice\FateDice {
20
+            'fate'  => function(): Dice\FateDice {
21 21
                 return new Dice\FateDice();
22 22
             },
23 23
         ];
Please login to merge, or discard this patch.
src/RequestHandler/DiceRequestHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
             return $this->writeAppropriateFormatResponse($request, $diceResponse, $diceCollection);
57 57
         } catch (UncreatableDiceException $creationError) {
58 58
             return $diceResponse->withStatus(400)
59
-                ->write("Unable to roll diceCollection: " . $creationError->getMessage());
59
+                ->write("Unable to roll diceCollection: ".$creationError->getMessage());
60 60
         } catch (UnrenderableDiceException $renderError) {
61 61
             return $diceResponse->withStatus(400)
62
-                ->write("Unable to render request: " . $renderError->getMessage());
62
+                ->write("Unable to render request: ".$renderError->getMessage());
63 63
         }
64 64
     }
65 65
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 ->withHeader("Content-Type", $renderer->contentType());
90 90
         } catch (UnknownRendererException $error) {
91 91
             return $response->withStatus(406)
92
-                ->write("Not sure how to respond with: " . $requestedContentType);
92
+                ->write("Not sure how to respond with: ".$requestedContentType);
93 93
         }
94 94
     }
95 95
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     {
103 103
         $rolledValue = $request->getHeader('totally-legit')[0];
104 104
         return array_map(
105
-            function (Dice $dice) use ($rolledValue): Dice {
105
+            function(Dice $dice) use ($rolledValue): Dice {
106 106
                 return new TotallyLegit($dice, (int) $rolledValue);
107 107
             },
108 108
             $diceCollection
Please login to merge, or discard this patch.
src/DiceApp.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     public static function buildIndex(): string
47 47
     {
48 48
         $converter = new CommonMarkConverter();
49
-        $indexBody = $converter->convertToHtml(file_contents(__DIR__ . "/../README.md"));
50
-        $indexContent = file_contents(__DIR__ . "/../www/templates/index.html");
49
+        $indexBody = $converter->convertToHtml(file_contents(__DIR__."/../README.md"));
50
+        $indexContent = file_contents(__DIR__."/../www/templates/index.html");
51 51
         $indexContent = str_replace("{{body}}", $indexBody, $indexContent);
52 52
         file_put_contents(self::INDEX_FILE_PATH, $indexContent);
53 53
         return $indexContent;
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $diceRequestHandler = $this->diceRequestHandler;
96 96
         $this->get(
97
-            "/{$path}" . self::DICE_PATH_REGEX,
98
-            function (Request $request, Response $response, $args) use ($diceRequestHandler, $contentType): Response {
97
+            "/{$path}".self::DICE_PATH_REGEX,
98
+            function(Request $request, Response $response, $args) use ($diceRequestHandler, $contentType): Response {
99 99
                 return $diceRequestHandler->getDice(
100 100
                     $request->withHeader('accept', $contentType),
101 101
                     $response,
Please login to merge, or discard this patch.