Skip to content

Commit d08aa6c

Browse files
committed
[CLEANUP] Avoid Hungarian notation in OutputFormat (part 7)
Also rename the getters to match the new property names. Part of #756
1 parent 008d2fb commit d08aa6c

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

src/OutputFormat.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,24 @@ class OutputFormat
125125
/**
126126
* @var string
127127
*/
128-
private $sSpaceBeforeOpeningBrace = ' ';
128+
private $spaceBeforeOpeningBrace = ' ';
129129

130130
/**
131131
* Content injected in and around declaration blocks.
132132
*
133133
* @var string
134134
*/
135-
private $sBeforeDeclarationBlock = '';
135+
private $contentBeforeDeclarationBlock = '';
136136

137137
/**
138138
* @var string
139139
*/
140-
private $sAfterDeclarationBlockSelectors = '';
140+
private $contentAfterDeclarationBlockSelectors = '';
141141

142142
/**
143143
* @var string
144144
*/
145-
private $sAfterDeclarationBlock = '';
145+
private $contentAfterDeclarationBlock = '';
146146

147147
/**
148148
* Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
@@ -537,69 +537,69 @@ public function setSpaceAfterListArgumentSeparators(array $separatorSpaces): sel
537537
*/
538538
public function getSpaceBeforeOpeningBrace(): string
539539
{
540-
return $this->sSpaceBeforeOpeningBrace;
540+
return $this->spaceBeforeOpeningBrace;
541541
}
542542

543543
/**
544544
* @return $this fluent interface
545545
*/
546546
public function setSpaceBeforeOpeningBrace(string $whitespace): self
547547
{
548-
$this->sSpaceBeforeOpeningBrace = $whitespace;
548+
$this->spaceBeforeOpeningBrace = $whitespace;
549549

550550
return $this;
551551
}
552552

553553
/**
554554
* @internal
555555
*/
556-
public function getBeforeDeclarationBlock(): string
556+
public function getContentBeforeDeclarationBlock(): string
557557
{
558-
return $this->sBeforeDeclarationBlock;
558+
return $this->contentBeforeDeclarationBlock;
559559
}
560560

561561
/**
562562
* @return $this fluent interface
563563
*/
564564
public function setBeforeDeclarationBlock(string $content): self
565565
{
566-
$this->sBeforeDeclarationBlock = $content;
566+
$this->contentBeforeDeclarationBlock = $content;
567567

568568
return $this;
569569
}
570570

571571
/**
572572
* @internal
573573
*/
574-
public function getAfterDeclarationBlockSelectors(): string
574+
public function getContentAfterDeclarationBlockSelectors(): string
575575
{
576-
return $this->sAfterDeclarationBlockSelectors;
576+
return $this->contentAfterDeclarationBlockSelectors;
577577
}
578578

579579
/**
580580
* @return $this fluent interface
581581
*/
582582
public function setAfterDeclarationBlockSelectors(string $content): self
583583
{
584-
$this->sAfterDeclarationBlockSelectors = $content;
584+
$this->contentAfterDeclarationBlockSelectors = $content;
585585

586586
return $this;
587587
}
588588

589589
/**
590590
* @internal
591591
*/
592-
public function getAfterDeclarationBlock(): string
592+
public function getContentAfterDeclarationBlock(): string
593593
{
594-
return $this->sAfterDeclarationBlock;
594+
return $this->contentAfterDeclarationBlock;
595595
}
596596

597597
/**
598598
* @return $this fluent interface
599599
*/
600600
public function setAfterDeclarationBlock(string $content): self
601601
{
602-
$this->sAfterDeclarationBlock = $content;
602+
$this->contentAfterDeclarationBlock = $content;
603603

604604
return $this;
605605
}

src/RuleSet/DeclarationBlock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@ public function render(OutputFormat $outputFormat): string
160160
// If all the selectors have been removed, this declaration block becomes invalid
161161
throw new OutputException('Attempt to print declaration block with missing selector', $this->lineNumber);
162162
}
163-
$result .= $outputFormat->getBeforeDeclarationBlock();
163+
$result .= $outputFormat->getContentBeforeDeclarationBlock();
164164
$result .= $outputFormat->implode(
165165
$outputFormat->spaceBeforeSelectorSeparator() . ',' . $outputFormat->spaceAfterSelectorSeparator(),
166166
$this->selectors
167167
);
168-
$result .= $outputFormat->getAfterDeclarationBlockSelectors();
168+
$result .= $outputFormat->getContentAfterDeclarationBlockSelectors();
169169
$result .= $outputFormat->spaceBeforeOpeningBrace() . '{';
170170
$result .= $this->renderRules($outputFormat);
171171
$result .= '}';
172-
$result .= $outputFormat->getAfterDeclarationBlock();
172+
$result .= $outputFormat->getContentAfterDeclarationBlock();
173173
return $result;
174174
}
175175
}

tests/Unit/OutputFormatTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ public function setSpaceBeforeOpeningBraceProvidesFluentInterface(): void
552552
/**
553553
* @test
554554
*/
555-
public function getBeforeDeclarationBlockInitiallyReturnsEmptyString(): void
555+
public function getContentBeforeDeclarationBlockInitiallyReturnsEmptyString(): void
556556
{
557-
self::assertSame('', $this->subject->getBeforeDeclarationBlock());
557+
self::assertSame('', $this->subject->getContentBeforeDeclarationBlock());
558558
}
559559

560560
/**
@@ -565,7 +565,7 @@ public function setBeforeDeclarationBlockSetsBeforeDeclarationBlock(): void
565565
$value = ' ';
566566
$this->subject->setBeforeDeclarationBlock($value);
567567

568-
self::assertSame($value, $this->subject->getBeforeDeclarationBlock());
568+
self::assertSame($value, $this->subject->getContentBeforeDeclarationBlock());
569569
}
570570

571571
/**
@@ -579,9 +579,9 @@ public function setBeforeDeclarationBlockProvidesFluentInterface(): void
579579
/**
580580
* @test
581581
*/
582-
public function getAfterDeclarationBlockSelectorsInitiallyReturnsEmptyString(): void
582+
public function getContentAfterDeclarationBlockSelectorsInitiallyReturnsEmptyString(): void
583583
{
584-
self::assertSame('', $this->subject->getAfterDeclarationBlockSelectors());
584+
self::assertSame('', $this->subject->getContentAfterDeclarationBlockSelectors());
585585
}
586586

587587
/**
@@ -592,7 +592,7 @@ public function setAfterDeclarationBlockSelectorsSetsAfterDeclarationBlockSelect
592592
$value = ' ';
593593
$this->subject->setAfterDeclarationBlockSelectors($value);
594594

595-
self::assertSame($value, $this->subject->getAfterDeclarationBlockSelectors());
595+
self::assertSame($value, $this->subject->getContentAfterDeclarationBlockSelectors());
596596
}
597597

598598
/**
@@ -606,9 +606,9 @@ public function setAfterDeclarationBlockSelectorsProvidesFluentInterface(): void
606606
/**
607607
* @test
608608
*/
609-
public function getAfterDeclarationBlockInitiallyReturnsEmptyString(): void
609+
public function getContentAfterDeclarationBlockInitiallyReturnsEmptyString(): void
610610
{
611-
self::assertSame('', $this->subject->getAfterDeclarationBlock());
611+
self::assertSame('', $this->subject->getContentAfterDeclarationBlock());
612612
}
613613

614614
/**
@@ -619,7 +619,7 @@ public function setAfterDeclarationBlockSetsAfterDeclarationBlock(): void
619619
$value = ' ';
620620
$this->subject->setAfterDeclarationBlock($value);
621621

622-
self::assertSame($value, $this->subject->getAfterDeclarationBlock());
622+
self::assertSame($value, $this->subject->getContentAfterDeclarationBlock());
623623
}
624624

625625
/**

0 commit comments

Comments
 (0)