@@ -26,7 +26,7 @@ |
||
| 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() |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $data = []; |
| 67 | 67 | $valid = preg_match("/(?P<count>[0-9]+)?d(?P<size>[0-9]+)/i", $part, $data); |
| 68 | 68 | if (!$valid) { |
| 69 | - throw new UncreatableDiceException("Problem creating dice from incorrectly formated data: " + $part); |
|
| 69 | + throw new UncreatableDiceException("Problem creating dice from incorrectly formated data: " +$part); |
|
| 70 | 70 | } |
| 71 | 71 | if (!$data["count"]) { |
| 72 | 72 | $data["count"] = 1; |
@@ -24,14 +24,14 @@ |
||
| 24 | 24 | $this->get("/dice-stats", [$this, 'diceStats']); |
| 25 | 25 | $this->get("{dice:(?:/[0-9]*[dD][0-9]+)+/?}", [$this->diceRequestHandler, 'getDice']); |
| 26 | 26 | |
| 27 | - $this->get("/html{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function (Request $request, $response, $args) { |
|
| 27 | + $this->get("/html{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function(Request $request, $response, $args) { |
|
| 28 | 28 | return $this->diceRequestHandler->getDice( |
| 29 | 29 | $request->withHeader('accept', 'text/html'), |
| 30 | 30 | $response, |
| 31 | 31 | $args |
| 32 | 32 | ); |
| 33 | 33 | }); |
| 34 | - $this->get("/json{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function (Request $request, $response, $args) { |
|
| 34 | + $this->get("/json{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function(Request $request, $response, $args) { |
|
| 35 | 35 | return $this->diceRequestHandler->getDice( |
| 36 | 36 | $request->withHeader('accept', 'application/json'), |
| 37 | 37 | $response, |
@@ -69,7 +69,7 @@ |
||
| 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 |