Skip to content

Commit 1229b3b

Browse files
authored
[CLEANUP] Avoid Hungarian notation in OutputFormat (part 4) (#1115)
Also rename the (internal) getters to match the changed property names. Part of #756
1 parent 7d45a7f commit 1229b3b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/CSSList/AtRuleBlockList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ public function __toString(): string
5353
public function render(OutputFormat $outputFormat): string
5454
{
5555
$result = $outputFormat->comments($this);
56-
$result .= $outputFormat->getBeforeAtRuleBlock();
56+
$result .= $outputFormat->getContentBeforeAtRuleBlock();
5757
$arguments = $this->arguments;
5858
if ($arguments) {
5959
$arguments = ' ' . $arguments;
6060
}
6161
$result .= "@{$this->type}$arguments{$outputFormat->spaceBeforeOpeningBrace()}{";
6262
$result .= $this->renderListContents($outputFormat);
6363
$result .= '}';
64-
$result .= $outputFormat->getAfterAtRuleBlock();
64+
$result .= $outputFormat->getContentAfterAtRuleBlock();
6565
return $result;
6666
}
6767

src/OutputFormat.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ class OutputFormat
7575
*
7676
* @var string
7777
*/
78-
private $sBeforeAtRuleBlock = '';
78+
private $contentBeforeAtRuleBlock = '';
7979

8080
/**
8181
* @var string
8282
*/
83-
private $sAfterAtRuleBlock = '';
83+
private $contentAfterAtRuleBlock = '';
8484

8585
/**
8686
* This is what’s printed before and after the comma if a declaration block contains multiple selectors.
@@ -383,35 +383,35 @@ public function setSpaceBetweenBlocks(string $whitespace): self
383383
/**
384384
* @internal
385385
*/
386-
public function getBeforeAtRuleBlock(): string
386+
public function getContentBeforeAtRuleBlock(): string
387387
{
388-
return $this->sBeforeAtRuleBlock;
388+
return $this->contentBeforeAtRuleBlock;
389389
}
390390

391391
/**
392392
* @return $this fluent interface
393393
*/
394394
public function setBeforeAtRuleBlock(string $content): self
395395
{
396-
$this->sBeforeAtRuleBlock = $content;
396+
$this->contentBeforeAtRuleBlock = $content;
397397

398398
return $this;
399399
}
400400

401401
/**
402402
* @internal
403403
*/
404-
public function getAfterAtRuleBlock(): string
404+
public function getContentAfterAtRuleBlock(): string
405405
{
406-
return $this->sAfterAtRuleBlock;
406+
return $this->contentAfterAtRuleBlock;
407407
}
408408

409409
/**
410410
* @return $this fluent interface
411411
*/
412412
public function setAfterAtRuleBlock(string $content): self
413413
{
414-
$this->sAfterAtRuleBlock = $content;
414+
$this->contentAfterAtRuleBlock = $content;
415415

416416
return $this;
417417
}

tests/Unit/OutputFormatTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ public function setSpaceBetweenBlocksProvidesFluentInterface(): void
309309
/**
310310
* @test
311311
*/
312-
public function getBeforeAtRuleBlockInitiallyReturnsEmptyString(): void
312+
public function getContentBeforeAtRuleBlockInitiallyReturnsEmptyString(): void
313313
{
314-
self::assertSame('', $this->subject->getBeforeAtRuleBlock());
314+
self::assertSame('', $this->subject->getContentBeforeAtRuleBlock());
315315
}
316316

317317
/**
@@ -322,7 +322,7 @@ public function setBeforeAtRuleBlockSetsBeforeAtRuleBlock(): void
322322
$value = ' ';
323323
$this->subject->setBeforeAtRuleBlock($value);
324324

325-
self::assertSame($value, $this->subject->getBeforeAtRuleBlock());
325+
self::assertSame($value, $this->subject->getContentBeforeAtRuleBlock());
326326
}
327327

328328
/**
@@ -336,9 +336,9 @@ public function setBeforeAtRuleBlockProvidesFluentInterface(): void
336336
/**
337337
* @test
338338
*/
339-
public function getAfterAtRuleBlockInitiallyReturnsEmptyString(): void
339+
public function getContentAfterAtRuleBlockInitiallyReturnsEmptyString(): void
340340
{
341-
self::assertSame('', $this->subject->getAfterAtRuleBlock());
341+
self::assertSame('', $this->subject->getContentAfterAtRuleBlock());
342342
}
343343

344344
/**
@@ -349,7 +349,7 @@ public function setAfterAtRuleBlockSetsAfterAtRuleBlock(): void
349349
$value = ' ';
350350
$this->subject->setAfterAtRuleBlock($value);
351351

352-
self::assertSame($value, $this->subject->getAfterAtRuleBlock());
352+
self::assertSame($value, $this->subject->getContentAfterAtRuleBlock());
353353
}
354354

355355
/**

0 commit comments

Comments
 (0)