Skip to content

Commit 5be7afa

Browse files
committed
[CLEANUP] Avoid Hungarian notation in OutputFormat (part 8)
Also rename the getters to match the new property names. Part of #756
1 parent 9eb6c43 commit 5be7afa

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/OutputFormat.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ class OutputFormat
149149
*
150150
* @var string
151151
*/
152-
private $sIndentation = "\t";
152+
private $indentation = "\t";
153153

154154
/**
155155
* Output exceptions.
156156
*
157157
* @var bool
158158
*/
159-
private $bIgnoreExceptions = false;
159+
private $shouldIgnoreExceptions = false;
160160

161161
/**
162162
* Render comments for lists and RuleSets
@@ -609,33 +609,33 @@ public function setAfterDeclarationBlock(string $content): self
609609
*/
610610
public function getIndentation(): string
611611
{
612-
return $this->sIndentation;
612+
return $this->indentation;
613613
}
614614

615615
/**
616616
* @return $this fluent interface
617617
*/
618618
public function setIndentation(string $indentation): self
619619
{
620-
$this->sIndentation = $indentation;
620+
$this->indentation = $indentation;
621621

622622
return $this;
623623
}
624624

625625
/**
626626
* @internal
627627
*/
628-
public function getIgnoreExceptions(): bool
628+
public function shouldIgnoreExceptions(): bool
629629
{
630-
return $this->bIgnoreExceptions;
630+
return $this->shouldIgnoreExceptions;
631631
}
632632

633633
/**
634634
* @return $this fluent interface
635635
*/
636636
public function setIgnoreExceptions(bool $ignoreExceptions): self
637637
{
638-
$this->bIgnoreExceptions = $ignoreExceptions;
638+
$this->shouldIgnoreExceptions = $ignoreExceptions;
639639

640640
return $this;
641641
}
@@ -697,7 +697,7 @@ public function nextLevel(): self
697697

698698
public function beLenient(): void
699699
{
700-
$this->bIgnoreExceptions = true;
700+
$this->shouldIgnoreExceptions = true;
701701
}
702702

703703
/**

src/OutputFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function spaceBeforeOpeningBrace(): string
148148
*/
149149
public function safely(callable $callable): ?string
150150
{
151-
if ($this->outputFormat->getIgnoreExceptions()) {
151+
if ($this->outputFormat->shouldIgnoreExceptions()) {
152152
// If output exceptions are ignored, run the code with exception guards
153153
try {
154154
return $callable();

tests/Unit/OutputFormatTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,9 @@ public function setIndentationProvidesFluentInterface(): void
660660
/**
661661
* @test
662662
*/
663-
public function getIgnoreExceptionsInitiallyReturnsFalse(): void
663+
public function shouldIgnoreExceptionsInitiallyReturnsFalse(): void
664664
{
665-
self::assertFalse($this->subject->getIgnoreExceptions());
665+
self::assertFalse($this->subject->shouldIgnoreExceptions());
666666
}
667667

668668
/**
@@ -674,7 +674,7 @@ public function setIgnoreExceptionsSetsIgnoreExceptions(bool $value): void
674674
{
675675
$this->subject->setIgnoreExceptions($value);
676676

677-
self::assertSame($value, $this->subject->getIgnoreExceptions());
677+
self::assertSame($value, $this->subject->shouldIgnoreExceptions());
678678
}
679679

680680
/**
@@ -866,7 +866,7 @@ public function beLenientSetsIgnoreExceptionsToTrue(): void
866866

867867
$this->subject->beLenient();
868868

869-
self::assertTrue($this->subject->getIgnoreExceptions());
869+
self::assertTrue($this->subject->shouldIgnoreExceptions());
870870
}
871871

872872
/**

0 commit comments

Comments
 (0)