1 | <?php |
||
8 | class DefaultFormatter extends BaseFormatter { |
||
9 | |||
10 | private $preCommands; |
||
11 | private $postCommands; |
||
12 | private $showToken = true; |
||
13 | |||
14 | 2 | protected function init() { |
|
18 | |||
19 | 2 | public function addPreWrite($content = '') { |
|
22 | |||
23 | 1 | public function addPreWriteln($content = '') { |
|
26 | |||
27 | public function addPreIndent() { |
||
28 | $this->preCommands->enqueue(['indent']); |
||
29 | } |
||
30 | |||
31 | 2 | public function addPreOutdent() { |
|
34 | |||
35 | 2 | public function addPostWrite($content = '') { |
|
38 | |||
39 | 2 | public function addPostWriteln($content = '') { |
|
42 | |||
43 | 2 | public function addPostIndent() { |
|
46 | |||
47 | public function addPostOutdent() { |
||
48 | $this->postCommands->enqueue(['outdent']); |
||
49 | } |
||
50 | |||
51 | public function hideToken() { |
||
52 | $this->showToken = false; |
||
53 | } |
||
54 | |||
55 | 2 | protected function doVisitToken(Token $token) { |
|
80 | |||
81 | 2 | private function processCommands(Queue $commands) { |
|
102 | |||
103 | } |
||
104 |