@@ -40,6 +40,9 @@ discard block |
||
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 | |
43 | + /** |
|
44 | + * @param string $message |
|
45 | + */ |
|
43 | 46 | public function write($message) { |
44 | 47 | call_user_func($this->printer, $message); |
45 | 48 | } |
@@ -62,6 +65,9 @@ discard block |
||
62 | 65 | $this->exceptionHandler = $exceptionHandler; |
63 | 66 | } |
64 | 67 | |
68 | + /** |
|
69 | + * @param \Exception $message |
|
70 | + */ |
|
65 | 71 | public function handleException($message) { |
66 | 72 | call_user_func($this->exceptionHandler, $message); |
67 | 73 | } |
@@ -16,10 +16,10 @@ |
||
16 | 16 | */ |
17 | 17 | public function __construct(callable $runner) { |
18 | 18 | $this->runner = $runner; |
19 | - $this->printer = function ($string) { |
|
19 | + $this->printer = function($string) { |
|
20 | 20 | echo $string; |
21 | 21 | }; |
22 | - $this->exceptionHandler = function (\Exception $exception) { |
|
22 | + $this->exceptionHandler = function(\Exception $exception) { |
|
23 | 23 | $message = get_class($exception) . ': ' . $exception->getMessage() . ' ' . |
24 | 24 | '[' . $exception->getFile() . ':' . $exception->getLine() . ']' . "\n" . |
25 | 25 | $exception->getTraceAsString(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | header('X-Accel-Buffering: no'); |
29 | 29 | ob_end_flush(); |
30 | 30 | |
31 | - $value->setPrinter(function ($string) { |
|
31 | + $value->setPrinter(function($string) { |
|
32 | 32 | echo $string; |
33 | 33 | |
34 | 34 | $length = strlen($string); |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | flush(); |
40 | 40 | ob_flush(); |
41 | 41 | }); |
42 | - $value->setExceptionHandler(function (\Exception $exception) { |
|
42 | + $value->setExceptionHandler(function(\Exception $exception) { |
|
43 | 43 | echo '</pre>'; |
44 | 44 | echo new Element('div', ['class' => 'alert alert-danger'], [ |
45 | 45 | htmlentities($exception->getMessage()) |
46 | 46 | ]); |
47 | 47 | }); |
48 | 48 | |
49 | - return new DelayedOutput(function () use ($value) { |
|
49 | + return new DelayedOutput(function() use ($value) { |
|
50 | 50 | $value->write('<pre>'); |
51 | 51 | $value->__toString(); |
52 | 52 | $value->write('</pre>'); |