diff --git a/src/OutputFormat.php b/src/OutputFormat.php index 1068fa1f..98f394b0 100644 --- a/src/OutputFormat.php +++ b/src/OutputFormat.php @@ -820,12 +820,18 @@ public static function create(): self public static function createCompact(): self { $format = self::create(); - $format->set('Space*Rules', '') - ->set('Space*Blocks', '') + $format + ->setSpaceBeforeRules('') + ->setSpaceBetweenRules('') + ->setSpaceAfterRules('') + ->setSpaceBeforeBlocks('') + ->setSpaceBetweenBlocks('') + ->setSpaceAfterBlocks('') ->setSpaceAfterRuleName('') ->setSpaceBeforeOpeningBrace('') ->setSpaceAfterSelectorSeparator('') ->setRenderComments(false); + return $format; } @@ -835,11 +841,16 @@ public static function createCompact(): self public static function createPretty(): self { $format = self::create(); - $format->set('Space*Rules', "\n") - ->set('Space*Blocks', "\n") + $format + ->setSpaceBeforeRules("\n") + ->setSpaceBetweenRules("\n") + ->setSpaceAfterRules("\n") + ->setSpaceBeforeBlocks("\n") ->setSpaceBetweenBlocks("\n\n") - ->set('SpaceAfterListArgumentSeparators', [',' => ' ']) + ->setSpaceAfterBlocks("\n") + ->setSpaceAfterListArgumentSeparators([',' => ' ']) ->setRenderComments(true); + return $format; } } diff --git a/tests/Unit/OutputFormatTest.php b/tests/Unit/OutputFormatTest.php index 2b60b52c..8792892d 100644 --- a/tests/Unit/OutputFormatTest.php +++ b/tests/Unit/OutputFormatTest.php @@ -896,6 +896,14 @@ public function createReturnsOutputFormatInstance(): void self::assertInstanceOf(OutputFormat::class, OutputFormat::create()); } + /** + * @test + */ + public function createCreatesInstanceWithDefaultSettings(): void + { + self::assertEquals(new OutputFormat(), OutputFormat::create()); + } + /** * @test */