@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | $this->get("/dice-stats", [$this, 'diceStats']); |
| 35 | 35 | $this->get("{dice:(?:/[0-9]*[dD][0-9]+)+/?}", [$this, 'getDice']); |
| 36 | 36 | |
| 37 | - $this->get("/html{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function (Request $request, $response, $args) { |
|
| 37 | + $this->get("/html{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function(Request $request, $response, $args) { |
|
| 38 | 38 | return $this->getDice($request->withHeader('accept', 'text/html'), $response, $args); |
| 39 | 39 | }); |
| 40 | - $this->get("/json{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function (Request $request, $response, $args) { |
|
| 40 | + $this->get("/json{dice:(?:/[0-9]*[dD][0-9]+)+/?}", function(Request $request, $response, $args) { |
|
| 41 | 41 | return $this->getDice($request->withHeader('accept', 'application/json'), $response, $args); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $rolledValue = $request->getHeader('totally-legit')[0]; |
| 107 | 107 | return array_map( |
| 108 | - function (Dice $dice) use ($rolledValue) { |
|
| 108 | + function(Dice $dice) use ($rolledValue) { |
|
| 109 | 109 | return new TotallyLegit($dice, (int) $rolledValue); |
| 110 | 110 | }, |
| 111 | 111 | $dice |
@@ -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() |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | public function diceFromUrlString($urlString) |
| 11 | 11 | { |
| 12 | 12 | $parts = explode("/", $urlString); |
| 13 | - $parts = array_filter($parts, function($part) {return $part !== "";}); |
|
| 13 | + $parts = array_filter($parts, function($part) {return $part !== ""; }); |
|
| 14 | 14 | $diceSets = array_map([$this, 'getDiceForPart'], $parts); |
| 15 | 15 | return $this->flattenDiceSets($diceSets); |
| 16 | 16 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 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; |