From ed411af89dd6dfe72d9dc72858bcd3c569e10879 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 8 Feb 2025 14:22:31 +0100 Subject: [PATCH 1/2] [TASK] Only allow `string` for some `OutputFormat` properties `sBeforeAfterListArgumentSeparator` and `sSpaceAfterListArgumentSeparator` now can only hold strings, and no longer arrays (which was deprecated in V8.8.0). --- src/OutputFormat.php | 18 ++++-------------- tests/OutputFormatTest.php | 20 -------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/src/OutputFormat.php b/src/OutputFormat.php index f485d1c5..8bdfdb1d 100644 --- a/src/OutputFormat.php +++ b/src/OutputFormat.php @@ -124,10 +124,7 @@ class OutputFormat /** * This is what’s inserted before the separator in value lists, by default. * - * `array` is deprecated in version 8.8.0, and will be removed in version 9.0.0. - * To set the spacing for specific separators, use {@see $aSpaceBeforeListArgumentSeparators} instead. - * - * @var string|array + * @var string * * @internal since 8.8.0, will be made private in 9.0.0 */ @@ -145,10 +142,7 @@ class OutputFormat /** * This is what’s inserted after the separator in value lists, by default. * - * `array` is deprecated in version 8.8.0, and will be removed in version 9.0.0. - * To set the spacing for specific separators, use {@see $aSpaceAfterListArgumentSeparators} instead. - * - * @var string|array + * @var string * * @internal since 8.8.0, will be made private in 9.0.0 */ @@ -597,21 +591,17 @@ public function setSpaceBeforeListArgumentSeparators(array $separatorSpaces): se } /** - * @return string|array - * * @internal */ - public function getSpaceAfterListArgumentSeparator() + public function getSpaceAfterListArgumentSeparator(): string { return $this->sSpaceAfterListArgumentSeparator; } /** - * @param string|array $whitespace - * * @return $this fluent interface */ - public function setSpaceAfterListArgumentSeparator($whitespace): self + public function setSpaceAfterListArgumentSeparator(string $whitespace): self { $this->sSpaceAfterListArgumentSeparator = $whitespace; diff --git a/tests/OutputFormatTest.php b/tests/OutputFormatTest.php index d34b08fc..c9d7b068 100644 --- a/tests/OutputFormatTest.php +++ b/tests/OutputFormatTest.php @@ -96,26 +96,6 @@ public function spaceAfterListArgumentSeparator(): void ); } - /** - * @test - * - * @deprecated since version 8.8.0; will be removed in version 9.0. - * Use `setSpaceAfterListArgumentSeparators()` to set different spacing per separator. - */ - public function spaceAfterListArgumentSeparatorComplexDeprecated(): void - { - self::assertSame( - '.main, .test {font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;background: white;}' - . "\n@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}", - $this->document->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator([ - 'default' => ' ', - ',' => "\t", - '/' => '', - ' ' => '', - ])) - ); - } - /** * @test */ From 0800673268abf770a02564fde5faf5d78cb0a625 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sun, 9 Feb 2025 15:09:00 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36f1f1be..72351773 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Please also have a look at our ### Changed +- Only allow `string` for some `OutputFormat` properties (#885) - Make all non-private properties `@internal` (#886) - Use more native type declarations and strict mode (#641, #772, #774, #778, #804, #841, #873, #875)