|
4 | 4 |
|
5 | 5 | use Sabberworm\CSS\Parsing\OutputException;
|
6 | 6 |
|
| 7 | +/** |
| 8 | + * Class OutputFormat |
| 9 | + * |
| 10 | + * @method OutputFormat setSemicolonAfterLastRule( bool $bSemicolonAfterLastRule ) Set whether semicolons are added after last rule. |
| 11 | + */ |
7 | 12 | class OutputFormat {
|
8 | 13 | /**
|
9 | 14 | * Value format
|
@@ -150,17 +155,36 @@ public function getFormatter() {
|
150 | 155 | public function level() {
|
151 | 156 | return $this->iIndentationLevel;
|
152 | 157 | }
|
153 |
| - |
| 158 | + |
| 159 | + /** |
| 160 | + * Create format. |
| 161 | + * |
| 162 | + * @return OutputFormat Format. |
| 163 | + */ |
154 | 164 | public static function create() {
|
155 | 165 | return new OutputFormat();
|
156 | 166 | }
|
157 |
| - |
| 167 | + |
| 168 | + /** |
| 169 | + * Create compact format. |
| 170 | + * |
| 171 | + * @return OutputFormat Format. |
| 172 | + */ |
158 | 173 | public static function createCompact() {
|
159 |
| - return self::create()->set('Space*Rules', "")->set('Space*Blocks', "")->setSpaceAfterRuleName('')->setSpaceBeforeOpeningBrace('')->setSpaceAfterSelectorSeparator(''); |
| 174 | + $format = self::create(); |
| 175 | + $format->set('Space*Rules', "")->set('Space*Blocks', "")->setSpaceAfterRuleName('')->setSpaceBeforeOpeningBrace('')->setSpaceAfterSelectorSeparator(''); |
| 176 | + return $format; |
160 | 177 | }
|
161 |
| - |
| 178 | + |
| 179 | + /** |
| 180 | + * Create pretty format. |
| 181 | + * |
| 182 | + * @return OutputFormat Format. |
| 183 | + */ |
162 | 184 | public static function createPretty() {
|
163 |
| - return self::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")->setSpaceBetweenBlocks("\n\n")->set('SpaceAfterListArgumentSeparator', array('default' => '', ',' => ' ')); |
| 185 | + $format = self::create(); |
| 186 | + $format->set('Space*Rules', "\n")->set('Space*Blocks', "\n")->setSpaceBetweenBlocks("\n\n")->set('SpaceAfterListArgumentSeparator', array('default' => '', ',' => ' ')); |
| 187 | + return $format; |
164 | 188 | }
|
165 | 189 | }
|
166 | 190 |
|
|
0 commit comments