From acc26ef593a0e9b8f5995a21a8a0963ec67a37a8 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Wed, 19 Mar 2025 22:33:13 +0100 Subject: [PATCH] [CLEANUP] Make annotations for `OutputFormat` more specific --- src/OutputFormat.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/OutputFormat.php b/src/OutputFormat.php index a0e8b8947..6ad45aa40 100644 --- a/src/OutputFormat.php +++ b/src/OutputFormat.php @@ -9,7 +9,7 @@ final class OutputFormat /** * Value format: `"` means double-quote, `'` means single-quote * - * @var string + * @var non-empty-string */ private $stringQuotingType = '"'; @@ -176,11 +176,13 @@ final class OutputFormat private $nextLevelFormat; /** - * @var int + * @var int<0, max> */ private $indentationLevel = 0; /** + * @return non-empty-string + * * @internal */ public function getStringQuotingType(): string @@ -189,6 +191,8 @@ public function getStringQuotingType(): string } /** + * @param non-empty-string $quotingType + * * @return $this fluent interface */ public function setStringQuotingType(string $quotingType): self @@ -639,6 +643,8 @@ public function setRenderComments(bool $renderComments): self } /** + * @return int<0, max> + * * @internal */ public function getIndentationLevel(): int @@ -647,6 +653,8 @@ public function getIndentationLevel(): int } /** + * @param int<1, max> $numberOfTabs + * * @return $this fluent interface */ public function indentWithTabs(int $numberOfTabs = 1): self @@ -655,6 +663,8 @@ public function indentWithTabs(int $numberOfTabs = 1): self } /** + * @param int<1, max> $numberOfSpaces + * * @return $this fluent interface */ public function indentWithSpaces(int $numberOfSpaces = 2): self