55/**
66 * Class OutputFormat
77 *
8- * @method OutputFormat setSemicolonAfterLastRule( bool $bSemicolonAfterLastRule ) Set whether semicolons are added after last rule.
8+ * @method OutputFormat setSemicolonAfterLastRule(bool $bSemicolonAfterLastRule) Set whether semicolons are added after
9+ * last rule.
910 */
1011class OutputFormat
1112{
1213 /**
13- * Value format
14- */
14+ * Value format
15+ */
1516 // " means double-quote, ' means single-quote
1617 public $ sStringQuotingType = '" ' ;
18+
1719 // Output RGB colors in hash notation if possible
1820 public $ bRGBHashNotation = true ;
1921
2022 /**
21- * Declaration format
22- */
23+ * Declaration format
24+ */
2325 // Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
2426 public $ bSemicolonAfterLastRule = true ;
2527
2628 /**
27- * Spacing
28- * Note that these strings are not sanity-checked: the value should only consist of whitespace
29- * Any newline character will be indented according to the current level.
30- * The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
31- */
29+ * Spacing
30+ * Note that these strings are not sanity-checked: the value should only consist of whitespace
31+ * Any newline character will be indented according to the current level.
32+ * The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
33+ */
3234 public $ sSpaceAfterRuleName = ' ' ;
3335
3436 public $ sSpaceBeforeRules = '' ;
37+
3538 public $ sSpaceAfterRules = '' ;
39+
3640 public $ sSpaceBetweenRules = '' ;
3741
3842 public $ sSpaceBeforeBlocks = '' ;
43+
3944 public $ sSpaceAfterBlocks = '' ;
45+
4046 public $ sSpaceBetweenBlocks = "\n" ;
4147
4248 // Content injected in and around @-rule blocks.
4349 public $ sBeforeAtRuleBlock = '' ;
50+
4451 public $ sAfterAtRuleBlock = '' ;
4552
4653 // This is what’s printed before and after the comma if a declaration block contains multiple selectors.
4754 public $ sSpaceBeforeSelectorSeparator = '' ;
55+
4856 public $ sSpaceAfterSelectorSeparator = ' ' ;
57+
4958 // This is what’s printed after the comma of value lists
5059 public $ sSpaceBeforeListArgumentSeparator = '' ;
60+
5161 public $ sSpaceAfterListArgumentSeparator = '' ;
5262
5363 public $ sSpaceBeforeOpeningBrace = ' ' ;
5464
5565 // Content injected in and around declaration blocks.
5666 public $ sBeforeDeclarationBlock = '' ;
67+
5768 public $ sAfterDeclarationBlockSelectors = '' ;
69+
5870 public $ sAfterDeclarationBlock = '' ;
5971
6072 /**
61- * Indentation
62- */
73+ * Indentation
74+ */
6375 // Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
6476 public $ sIndentation = "\t" ;
6577
6678 /**
67- * Output exceptions.
68- */
79+ * Output exceptions.
80+ */
6981 public $ bIgnoreExceptions = false ;
7082
71-
7283 private $ oFormatter = null ;
84+
7385 private $ oNextLevelFormat = null ;
86+
7487 private $ iIndentationLevel = 0 ;
7588
7689 public function __construct ()
@@ -93,7 +106,12 @@ public function set($aNames, $mValue)
93106 {
94107 $ aVarPrefixes = ['a ' , 's ' , 'm ' , 'b ' , 'f ' , 'o ' , 'c ' , 'i ' ];
95108 if (is_string ($ aNames ) && strpos ($ aNames , '* ' ) !== false ) {
96- $ aNames = [str_replace ('* ' , 'Before ' , $ aNames ), str_replace ('* ' , 'Between ' , $ aNames ), str_replace ('* ' , 'After ' , $ aNames )];
109+ $ aNames =
110+ [
111+ str_replace ('* ' , 'Before ' , $ aNames ),
112+ str_replace ('* ' , 'Between ' , $ aNames ),
113+ str_replace ('* ' , 'After ' , $ aNames ),
114+ ];
97115 } elseif (!is_array ($ aNames )) {
98116 $ aNames = [$ aNames ];
99117 }
0 commit comments