Completed
Push — master ( 12ea9a...ae2bec )
by Steve
01:53
created
src/Renderer/Json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
     private function diceAsAssocArrays(array $diceCollection)
28 28
     {
29
-        return array_map(function (Dice $dice) {
29
+        return array_map(function(Dice $dice) {
30 30
             return [
31 31
                 "value" => $dice->roll(),
32 32
                 "size" => "d" . $dice->size()
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
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
             $this->diceCounter->count($dice);
43 43
         } catch (UncreatableDiceException $creationError) {
44 44
             $diceResponse = $diceResponse->withStatus(400)
45
-                ->write("Unable to roll dice: " . $creationError->getMessage());
45
+                ->write("Unable to roll dice: ".$creationError->getMessage());
46 46
         } catch (UnrenderableDiceException $renderError) {
47 47
             $diceResponse = $diceResponse->withStatus(400)
48
-                ->write("Unable to render request: " . $renderError->getMessage());
48
+                ->write("Unable to render request: ".$renderError->getMessage());
49 49
         }
50 50
         return $diceResponse;
51 51
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 ->withHeader("Content-Type", $renderer->contentType());
61 61
         } catch (UnknownRendererException $error) {
62 62
             $responseWithOutput = $response->withStatus(406);
63
-            $responseWithOutput->write("Not sure how to respond with: " . $requestedContentType);
63
+            $responseWithOutput->write("Not sure how to respond with: ".$requestedContentType);
64 64
         }
65 65
         return $responseWithOutput;
66 66
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $rolledValue = $request->getHeader('totally-legit')[0];
71 71
         return array_map(
72
-            function (Dice $dice) use ($rolledValue) {
72
+            function(Dice $dice) use ($rolledValue) {
73 73
                 return new TotallyLegit($dice, (int) $rolledValue);
74 74
             },
75 75
             $dice
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
@@ -35,6 +35,6 @@
 block discarded – undo
35 35
         }
36 36
         $roll = $dice->roll();
37 37
         $url = "{$this->urlRoot}/images/poorly-drawn/d{$size}/{$roll}.png";
38
-        return '<img src="' . $url . '" />';
38
+        return '<img src="'.$url.'" />';
39 39
     }
40 40
 }
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
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
         $data = [];
71 71
         $valid = preg_match("/(?P<count>[0-9]+)?d(?P<type>[^\/]+)/i", $part, $data);
72 72
         if (!$valid) {
73
-            throw new UncreatableDiceException("Problem creating dice from incorrectly formated data: " . $part);
73
+            throw new UncreatableDiceException("Problem creating dice from incorrectly formated data: ".$part);
74 74
         }
75 75
         if (!$data["count"]) {
76 76
             $data["count"] = 1;
Please login to merge, or discard this patch.
src/Dice/Factories/SpecialDiceFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     public function __construct()
19 19
     {
20 20
         $this->diceTypeCallbacks = [
21
-            'steve' => function ($_type, $diceCount) {
21
+            'steve' => function($_type, $diceCount) {
22 22
                 $newDice = [];
23 23
                 for ($i = 0; $i < $diceCount; $i++) {
24 24
                     $newDice[] = new SteveDice();
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,11 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace MeadSteve\DiceApi\Dice\Factories;
4 4
 
5
-use MeadSteve\DiceApi\Dice\BasicDice;
6 5
 use MeadSteve\DiceApi\Dice;
7 6
 use MeadSteve\DiceApi\Dice\SteveDice;
8
-use MeadSteve\DiceApi\Dice\UncreatableDiceException;
9
-use MeadSteve\DiceApi\Dice\ZeropointDice;
10 7
 
11 8
 class SpecialDiceFactory implements DiceFactory
12 9
 {
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
@@ -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.
www/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 use MeadSteve\DiceApi\RequestHandler\DiceRequestHandler;
14 14
 use Predis\Client;
15 15
 
16
-require __DIR__ . "/../vendor/autoload.php";
16
+require __DIR__."/../vendor/autoload.php";
17 17
 
18 18
 $diceGenerator = new UrlDiceGenerator(
19 19
     new DiceFactoryCollection([
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 $rendererCollection = new RendererCollection([
26 26
     new Json(),
27
-    new Html('http://' . $_SERVER['HTTP_HOST'])
27
+    new Html('http://'.$_SERVER['HTTP_HOST'])
28 28
 ]);
29 29
 
30 30
 if (isset($_ENV['REDIS_URL'])) {
Please login to merge, or discard this patch.
src/DiceApp.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
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);
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 
60 60
         foreach ($this->diceRequestHandler->contentTypesForPaths() as $path => $contentType) {
61 61
             $this->get(
62
-                "/{$path}" . self::DICE_PATH_REGEX,
63
-                function (Request $request, $response, $args) use ($diceRequestHandler, $contentType) {
62
+                "/{$path}".self::DICE_PATH_REGEX,
63
+                function(Request $request, $response, $args) use ($diceRequestHandler, $contentType) {
64 64
                     return $diceRequestHandler->getDice(
65 65
                         $request->withHeader('accept', $contentType),
66 66
                         $response,
Please login to merge, or discard this patch.