@@ -92,19 +92,35 @@ public function stripSemicolon(&$lines)
9292 /**
9393 * Output lines inside a block
9494 *
95- * @param string $inner
9695 * @param \stdClass $block
9796 */
98- protected function blockLines ($ inner , $ block )
97+ protected function blockLines ($ block )
9998 {
99+ $ inner = $ this ->indentStr ();
100+
100101 $ glue = $ this ->break . $ inner ;
102+
101103 echo $ inner . implode ($ glue , $ block ->lines );
102104
103105 if (! empty ($ block ->children )) {
104106 echo $ this ->break ;
105107 }
106108 }
107109
110+ /**
111+ * Output block selectors
112+ *
113+ * @param \stdClass $block
114+ */
115+ protected function blockSelectors ($ block )
116+ {
117+ $ inner = $ this ->indentStr ();
118+
119+ echo $ inner
120+ . implode ($ this ->tagSeparator , $ block ->selectors )
121+ . $ this ->open . $ this ->break ;
122+ }
123+
108124 /**
109125 * Output non-empty block
110126 *
@@ -116,20 +132,16 @@ protected function block($block)
116132 return ;
117133 }
118134
119- $ inner = $ pre = $ this ->indentStr ();
135+ $ pre = $ this ->indentStr ();
120136
121137 if (! empty ($ block ->selectors )) {
122- echo $ pre
123- . implode ($ this ->tagSeparator , $ block ->selectors )
124- . $ this ->open . $ this ->break ;
138+ $ this ->blockSelectors ($ block );
125139
126140 $ this ->indentLevel ++;
127-
128- $ inner = $ this ->indentStr ();
129141 }
130142
131143 if (! empty ($ block ->lines )) {
132- $ this ->blockLines ($ inner , $ block );
144+ $ this ->blockLines ($ block );
133145 }
134146
135147 foreach ($ block ->children as $ child ) {
0 commit comments