PluginProbe
MaxButtons – Create buttons / 6.7
MaxButtons – Create buttons v6.7
6.23 6.24 6.25 6.26 6.26.1 6.27 6.28 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.1.1 7.1.2 7.1.3 7.10 7.11 7.13 7.13.1 7.13.2 7.13.3 All 100 releases
maxbuttons / assets / libraries / scssphp / src / Formatter / Debug.php

Debug.php in MaxButtons – Create buttons 6.7, at assets/libraries/scssphp/src/Formatter/Debug.php

98 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * SCSSPHP
4 *
5 * @copyright 2012-2015 Leaf Corcoran
6 *
7 * @license http://opensource.org/licenses/MIT MIT
8 *
9 * @link http://leafo.github.io/scssphp
10 */
11
12 namespace Leafo\ScssPhp\Formatter;
13
14 use Leafo\ScssPhp\Formatter;
15
16 /**
17 * SCSS debug formatter
18 *
19 * @author Anthon Pang <anthon.pang@gmail.com>
20 */
21 class Debug extends Formatter
22 {
23 /**
24 * {@inheritdoc}
25 */
26 public function __construct()
27 {
28 $this->indentLevel = 0;
29 $this->indentChar = '';
30 $this->break = "\n";
31 $this->open = ' {';
32 $this->close = ' }';
33 $this->tagSeparator = ', ';
34 $this->assignSeparator = ': ';
35 }
36
37 /**
38 * {@inheritdoc}
39 */
40 protected function blockLines($block)
41 {
42 if (empty($block->lines)) {
43 echo "block->lines: []\n";
44
45 return;
46 }
47
48 foreach ($block->lines as $index => $line) {
49 echo "block->lines[{$index}]: $line\n";
50 }
51 }
52
53 /**
54 * {@inheritdoc}
55 */
56 protected function blockSelectors($block)
57 {
58 if (empty($block->selectors)) {
59 echo "block->selectors: []\n";
60
61 return;
62 }
63
64 foreach ($block->selectors as $index => $selector) {
65 echo "block->selectors[{$index}]: $selector\n";
66 }
67 }
68
69 /**
70 * {@inheritdoc}
71 */
72 protected function blockChildren($block)
73 {
74 if (empty($block->children)) {
75 echo "block->children: []\n";
76
77 return;
78 }
79
80 foreach ($block->children as $i => $child) {
81 $this->block($child);
82 }
83 }
84
85 /**
86 * {@inheritdoc}
87 */
88 protected function block($block)
89 {
90 echo "block->type: {$block->type}\n" .
91 "block->depth: {$block->depth}\n";
92
93 $this->blockSelectors($block);
94 $this->blockLines($block);
95 $this->blockChildren($block);
96 }
97 }
98