Skip to content

Commit 84a8b69

Browse files
committed
[TASK] Remove the deprecated OutputFormat::level()
This method is an inconsistently-named alias of `OutputFormat::getIndentationLevel()`. Fixes #869
1 parent cde73cd commit 84a8b69

File tree

4 files changed

+2
-20
lines changed

4 files changed

+2
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Please also have a look at our
2828

2929
### Removed
3030

31+
- Remove `OutputFormat::level()` (#874))
3132
- Remove expansion of shorthand properties (#838)
3233
- Remove `Parser::setCharset/getCharset` (#808)
3334
- Remove `Rule::getValues()` (#582)

src/OutputFormat.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,6 @@ public function getFormatter()
287287
return $this->oFormatter;
288288
}
289289

290-
/**
291-
* @return int
292-
*/
293-
public function level()
294-
{
295-
return $this->iIndentationLevel;
296-
}
297-
298290
/**
299291
* Creates an instance of this class without any particular formatting settings.
300292
*/

src/OutputFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,6 @@ private function prepareSpace($sSpaceString): string
208208
*/
209209
private function indent(): string
210210
{
211-
return \str_repeat($this->oFormat->sIndentation, $this->oFormat->level());
211+
return \str_repeat($this->oFormat->sIndentation, $this->oFormat->getIndentationLevel());
212212
}
213213
}

tests/Unit/OutputFormatTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -833,17 +833,6 @@ public function getFormatterCalledTwoTimesReturnsSameInstance(): void
833833
self::assertSame($firstCallResult, $secondCallResult);
834834
}
835835

836-
/**
837-
* @test
838-
*/
839-
public function levelReturnsIndentationLevel(): void
840-
{
841-
$value = 4;
842-
$this->subject->setIndentationLevel($value);
843-
844-
self::assertSame($value, $this->subject->level());
845-
}
846-
847836
/**
848837
* @test
849838
*/

0 commit comments

Comments
 (0)