Skip to content

Commit 1fad44a

Browse files
authored
[TASK] Add native type declarations to OutputFormat (#875)
Also fix some type annotations.
1 parent 7275925 commit 1fad44a

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Please also have a look at our
2121
### Changed
2222

2323
- Use more native type declarations and strict mode
24-
(#641, #772, #774, #778, #804, #841, #873)
24+
(#641, #772, #774, #778, #804, #841, #873, #875)
2525
- Add visibility to all class/interface constants (#469)
2626

2727
### Deprecated

src/OutputFormat.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,9 @@ class OutputFormat
170170
public function __construct() {}
171171

172172
/**
173-
* @param string $sName
174-
*
175-
* @return string|null
173+
* @return string|int|bool|null
176174
*/
177-
public function get($sName)
175+
public function get(string $sName)
178176
{
179177
$aVarPrefixes = ['a', 's', 'm', 'b', 'f', 'o', 'c', 'i'];
180178
foreach ($aVarPrefixes as $sPrefix) {
@@ -258,10 +256,7 @@ public function indentWithSpaces(int $numberOfSpaces = 2): self
258256
return $this->setIndentation(\str_repeat(' ', $numberOfSpaces));
259257
}
260258

261-
/**
262-
* @return OutputFormat
263-
*/
264-
public function nextLevel()
259+
public function nextLevel(): self
265260
{
266261
if ($this->oNextLevelFormat === null) {
267262
$this->oNextLevelFormat = clone $this;
@@ -276,10 +271,7 @@ public function beLenient(): void
276271
$this->bIgnoreExceptions = true;
277272
}
278273

279-
/**
280-
* @return OutputFormatter
281-
*/
282-
public function getFormatter()
274+
public function getFormatter(): OutputFormatter
283275
{
284276
if ($this->oFormatter === null) {
285277
$this->oFormatter = new OutputFormatter($this);

0 commit comments

Comments
 (0)