Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | class Crunched extends Formatter |
||
23 | { |
||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | public function __construct() |
||
28 | { |
||
29 | $this->indentLevel = 0; |
||
30 | $this->indentChar = ' '; |
||
31 | $this->break = ''; |
||
32 | $this->open = '{'; |
||
33 | $this->close = '}'; |
||
34 | $this->tagSeparator = ','; |
||
35 | $this->assignSeparator = ':'; |
||
36 | $this->keepSemicolons = false; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function blockLines(OutputBlock $block) |
||
43 | { |
||
44 | $inner = $this->indentStr(); |
||
45 | |||
46 | $glue = $this->break . $inner; |
||
47 | |||
48 | foreach ($block->lines as $index => $line) { |
||
49 | if (substr($line, 0, 2) === '/*') { |
||
50 | unset($block->lines[$index]); |
||
51 | } |
||
52 | } |
||
53 | |||
54 | $this->write($inner . implode($glue, $block->lines)); |
||
55 | |||
56 | if (! empty($block->children)) { |
||
57 | $this->write($this->break); |
||
58 | } |
||
59 | } |
||
60 | } |
||
61 |