Skip to content

[CLEANUP] Avoid Hungarian notation in OutputFormat (part 8) #1125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions src/OutputFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ class OutputFormat
*
* @var string
*/
private $sIndentation = "\t";
private $indentation = "\t";

/**
* Output exceptions.
*
* @var bool
*/
private $bIgnoreExceptions = false;
private $shouldIgnoreExceptions = false;

/**
* Render comments for lists and RuleSets
Expand Down Expand Up @@ -609,33 +609,33 @@ public function setAfterDeclarationBlock(string $content): self
*/
public function getIndentation(): string
{
return $this->sIndentation;
return $this->indentation;
}

/**
* @return $this fluent interface
*/
public function setIndentation(string $indentation): self
{
$this->sIndentation = $indentation;
$this->indentation = $indentation;

return $this;
}

/**
* @internal
*/
public function getIgnoreExceptions(): bool
public function shouldIgnoreExceptions(): bool
{
return $this->bIgnoreExceptions;
return $this->shouldIgnoreExceptions;
}

/**
* @return $this fluent interface
*/
public function setIgnoreExceptions(bool $ignoreExceptions): self
{
$this->bIgnoreExceptions = $ignoreExceptions;
$this->shouldIgnoreExceptions = $ignoreExceptions;

return $this;
}
Expand Down Expand Up @@ -697,7 +697,7 @@ public function nextLevel(): self

public function beLenient(): void
{
$this->bIgnoreExceptions = true;
$this->shouldIgnoreExceptions = true;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/OutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function spaceBeforeOpeningBrace(): string
*/
public function safely(callable $callable): ?string
{
if ($this->outputFormat->getIgnoreExceptions()) {
if ($this->outputFormat->shouldIgnoreExceptions()) {
// If output exceptions are ignored, run the code with exception guards
try {
return $callable();
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/OutputFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,9 @@ public function setIndentationProvidesFluentInterface(): void
/**
* @test
*/
public function getIgnoreExceptionsInitiallyReturnsFalse(): void
public function shouldIgnoreExceptionsInitiallyReturnsFalse(): void
{
self::assertFalse($this->subject->getIgnoreExceptions());
self::assertFalse($this->subject->shouldIgnoreExceptions());
}

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

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

/**
Expand Down Expand Up @@ -866,7 +866,7 @@ public function beLenientSetsIgnoreExceptionsToTrue(): void

$this->subject->beLenient();

self::assertTrue($this->subject->getIgnoreExceptions());
self::assertTrue($this->subject->shouldIgnoreExceptions());
}

/**
Expand Down