1 | <?php namespace rtens\domin\delivery; |
||
3 | class DelayedOutput { |
||
4 | |||
5 | /** @var callable */ |
||
6 | private $runner; |
||
7 | |||
8 | /** @var callable */ |
||
9 | private $printer; |
||
10 | |||
11 | /** |
||
12 | * @param callable $runner Will be called with the object itself, returns void |
||
13 | */ |
||
14 | public function __construct(callable $runner) { |
||
20 | |||
21 | public function write($message) { |
||
24 | |||
25 | public function writeLine($message) { |
||
28 | |||
29 | function __toString() { |
||
33 | |||
34 | public function surroundWith($before, $after) { |
||
42 | |||
43 | /** |
||
44 | * @param callable $printer |
||
45 | */ |
||
46 | public function setPrinter(callable $printer) { |
||
49 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.