From 28dbb05aa9a3440f2a3590e938b0e7f46ab44a56 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sun, 2 Feb 2025 19:44:44 +0100 Subject: [PATCH 1/2] [TASK] Add type declarations for `OutputFormat::indentWith*` Also improve the naming of the parameters. --- CHANGELOG.md | 2 +- src/OutputFormat.php | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13d94fe3..36cf3f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ Please also have a look at our ### Changed - Use more native type declarations and strict mode - (#641, #772, #774, #778, #804, #841) + (#641, #772, #774, #778, #804, #841, #783) - Add visibility to all class/interface constants (#469) ### Deprecated diff --git a/src/OutputFormat.php b/src/OutputFormat.php index 3f126346..ce53bb1b 100644 --- a/src/OutputFormat.php +++ b/src/OutputFormat.php @@ -243,23 +243,19 @@ public function __call(string $sMethodName, array $aArguments) } /** - * @param int $iNumber - * - * @return self + * @return $this fluent interface */ - public function indentWithTabs($iNumber = 1) + public function indentWithTabs(int $numberOfTabs = 1): self { - return $this->setIndentation(\str_repeat("\t", $iNumber)); + return $this->setIndentation(\str_repeat("\t", $numberOfTabs)); } /** - * @param int $iNumber - * - * @return self + * @return $this fluent interface */ - public function indentWithSpaces($iNumber = 2) + public function indentWithSpaces(int $numberOfSpaces = 2): self { - return $this->setIndentation(\str_repeat(' ', $iNumber)); + return $this->setIndentation(\str_repeat(' ', $numberOfSpaces)); } /** From 75031bdd5ca1b2134cb23b03b56ae3c4cb29ca47 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sun, 2 Feb 2025 20:17:43 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md Co-authored-by: JakeQZ --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36cf3f00..ed27efb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ Please also have a look at our ### Changed - Use more native type declarations and strict mode - (#641, #772, #774, #778, #804, #841, #783) + (#641, #772, #774, #778, #804, #841, #873) - Add visibility to all class/interface constants (#469) ### Deprecated