Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/OutputFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class OutputFormat
/**
* Value format: `"` means double-quote, `'` means single-quote
*
* @var string
* @var non-empty-string
*/
private $stringQuotingType = '"';

Expand Down Expand Up @@ -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
Expand All @@ -189,6 +191,8 @@ public function getStringQuotingType(): string
}

/**
* @param non-empty-string $quotingType
*
* @return $this fluent interface
*/
public function setStringQuotingType(string $quotingType): self
Expand Down Expand Up @@ -639,6 +643,8 @@ public function setRenderComments(bool $renderComments): self
}

/**
* @return int<0, max>
*
* @internal
*/
public function getIndentationLevel(): int
Expand All @@ -647,6 +653,8 @@ public function getIndentationLevel(): int
}

/**
* @param int<1, max> $numberOfTabs
*
* @return $this fluent interface
*/
public function indentWithTabs(int $numberOfTabs = 1): self
Expand All @@ -655,6 +663,8 @@ public function indentWithTabs(int $numberOfTabs = 1): self
}

/**
* @param int<1, max> $numberOfSpaces

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setIndentation('') can be called directly to have no indentation.

*
* @return $this fluent interface
*/
public function indentWithSpaces(int $numberOfSpaces = 2): self
Expand Down