Completed
Pull Request — master (#17)
by Steve
03:18 queued 01:10
created
src/Dice/BasicDice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     public function roll()
22 22
     {
23
-        if (! function_exists('random_int')) {
23
+        if (!function_exists('random_int')) {
24 24
             return mt_rand(1, $this->size);
25 25
         }
26 26
 
Please login to merge, or discard this patch.
src/Renderer/Html.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,6 +40,6 @@
 block discarded – undo
40 40
         }
41 41
         $roll = $dice->roll();
42 42
         $url = "{$this->urlRoot}/images/poorly-drawn/{$name}/{$roll}.png";
43
-        return '<img src="' . $url . '" />';
43
+        return '<img src="'.$url.'" />';
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
src/Renderer/Json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
     private function diceAsAssocArrays(array $diceCollection)
33 33
     {
34
-        return array_map(function (Dice $dice) {
34
+        return array_map(function(Dice $dice) {
35 35
             return [
36 36
                 "value" => $dice->roll(),
37 37
                 "type"  => $dice->name()
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 () {
17
+            'steve' => function() {
18 18
                 return new Dice\SteveDice();
19 19
             },
20
-            'fate'  => function () {
20
+            'fate'  => function() {
21 21
                 return new Dice\FateDice();
22 22
             },
23 23
         ];
Please login to merge, or discard this patch.
src/UrlDiceGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         $data = [];
64 64
         $valid = preg_match("/(?P<count>[0-9]+)?d(?P<type>[^\/]+)/i", $part, $data);
65 65
         if (!$valid) {
66
-            throw new UncreatableDiceException("Problem creating dice from incorrectly formatted data: " . $part);
66
+            throw new UncreatableDiceException("Problem creating dice from incorrectly formatted data: ".$part);
67 67
         }
68 68
         if (!$data["count"]) {
69 69
             $data["count"] = 1;
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
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
             return $this->writeAppropriateFormatResponse($request, $diceResponse, $diceCollection);
42 42
         } catch (UncreatableDiceException $creationError) {
43 43
             return $diceResponse->withStatus(400)
44
-                ->write("Unable to roll diceCollection: " . $creationError->getMessage());
44
+                ->write("Unable to roll diceCollection: ".$creationError->getMessage());
45 45
         } catch (UnrenderableDiceException $renderError) {
46 46
             return $diceResponse->withStatus(400)
47
-                ->write("Unable to render request: " . $renderError->getMessage());
47
+                ->write("Unable to render request: ".$renderError->getMessage());
48 48
         }
49 49
     }
50 50
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                 ->withHeader("Content-Type", $renderer->contentType());
75 75
         } catch (UnknownRendererException $error) {
76 76
             return $response->withStatus(406)
77
-                ->write("Not sure how to respond with: " . $requestedContentType);
77
+                ->write("Not sure how to respond with: ".$requestedContentType);
78 78
         }
79 79
     }
80 80
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         $rolledValue = $request->getHeader('totally-legit')[0];
89 89
         return array_map(
90
-            function (Dice $dice) use ($rolledValue) {
90
+            function(Dice $dice) use ($rolledValue) {
91 91
                 return new TotallyLegit($dice, (int) $rolledValue);
92 92
             },
93 93
             $diceCollection
Please login to merge, or discard this patch.
www/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 use MeadSteve\DiceApi\RequestHandler\DiceRequestHandler;
16 16
 use Predis\Client;
17 17
 
18
-require __DIR__ . "/../vendor/autoload.php";
18
+require __DIR__."/../vendor/autoload.php";
19 19
 
20 20
 $diceGenerator = new UrlDiceGenerator(
21 21
     new DiceFactoryCollection([
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 $rendererCollection = new RendererCollection([
28 28
     new Json(),
29
-    new Html('http://' . $_SERVER['HTTP_HOST']),
29
+    new Html('http://'.$_SERVER['HTTP_HOST']),
30 30
     new Protobuf(),
31 31
     new Plain()
32 32
 ]);
Please login to merge, or discard this patch.
src/Renderer/Protobuf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 
34 34
     private function diceAsProtos(array $diceCollection)
35 35
     {
36
-        return array_map(function (Dice $dice) {
36
+        return array_map(function(Dice $dice) {
37 37
             $proto = new \MeadSteve\DiceApi\Protos\V1\Dice();
38 38
             $proto->setValue($dice->roll());
39 39
             $proto->setName($dice->name());
Please login to merge, or discard this patch.
src/Protos/V1/Meta/Dice.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
         $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
13 13
 
14 14
         if (static::$is_initialized == true) {
15
-          return;
15
+            return;
16 16
         }
17 17
         $pool->internalAddGeneratedFile(hex2bin(
18 18
             "0abf010a1170726f746f732f646963652e70726f746f121b4d6561645374" .
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
           return;
16 16
         }
17 17
         $pool->internalAddGeneratedFile(hex2bin(
18
-            "0abf010a1170726f746f732f646963652e70726f746f121b4d6561645374" .
19
-            "6576652e446963654170692e50726f746f732e563122230a044469636512" .
20
-            "0d0a0576616c7565180120012805120c0a046e616d65180220012809223b" .
21
-            "0a08526573706f6e7365122f0a046469636518012003280b32212e4d6561" .
22
-            "6453746576652e446963654170692e50726f746f732e56312e4469636542" .
23
-            "23e202204d65616453746576655c446963654170695c50726f746f735c56" .
18
+            "0abf010a1170726f746f732f646963652e70726f746f121b4d6561645374".
19
+            "6576652e446963654170692e50726f746f732e563122230a044469636512".
20
+            "0d0a0576616c7565180120012805120c0a046e616d65180220012809223b".
21
+            "0a08526573706f6e7365122f0a046469636518012003280b32212e4d6561".
22
+            "6453746576652e446963654170692e50726f746f732e56312e4469636542".
23
+            "23e202204d65616453746576655c446963654170695c50726f746f735c56".
24 24
             "315c4d657461620670726f746f33"
25 25
         ), true);
26 26
 
Please login to merge, or discard this patch.