| Total Complexity | 8 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | trait SpacingTrait |
||
| 15 | { |
||
| 16 | use ArgumentsTrait; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Parser used for scanning the text. |
||
| 20 | * |
||
| 21 | * @var Parser |
||
| 22 | */ |
||
| 23 | private $spacer = false; |
||
| 24 | |||
| 25 | 198 | private function pushSpacer(Context $context) |
|
| 26 | { |
||
| 27 | 198 | if ($this->spacer !== false) { |
|
|
|
|||
| 28 | 21 | $context->pushSpacer($this->spacer); |
|
| 29 | } |
||
| 30 | 198 | } |
|
| 31 | |||
| 32 | 197 | private function popSpacer(Context $context) |
|
| 36 | } |
||
| 37 | 197 | } |
|
| 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 | * |
||
| 45 | * @return $this |
||
| 46 | */ |
||
| 47 | 7 | public function spacing($spacer = true) |
|
| 60 |