Total Complexity | 8 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
14 | trait SpacingTrait |
||
15 | { |
||
16 | |||
17 | use ArgumentsTrait; |
||
18 | |||
19 | /** |
||
20 | * Parser used for scanning the text |
||
21 | * @var Parser |
||
22 | */ |
||
23 | private $spacer = false; |
||
24 | |||
25 | private function pushSpacer(Context $context) |
||
26 | { |
||
27 | if ($this->spacer !== false) { |
||
|
|||
28 | $context->pushSpacer($this->spacer); |
||
29 | } |
||
30 | } |
||
31 | |||
32 | private function popSpacer(Context $context) |
||
36 | } |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Set a spacing parser for this parser or disable or enable (if a previous |
||
41 | * spacing parser is enabled) spacing parsing. |
||
42 | * |
||
43 | * @param Parser|bool|null $spacer |
||
44 | * @return $this |
||
45 | */ |
||
46 | public function spacing($spacer = true) |
||
60 |