Skip to content
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
4 changes: 2 additions & 2 deletions src/CSSList/AtRuleBlockList.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public function __toString(): string
public function render(OutputFormat $outputFormat): string
{
$result = $outputFormat->comments($this);
$result .= $outputFormat->getBeforeAtRuleBlock();
$result .= $outputFormat->getContentBeforeAtRuleBlock();
$arguments = $this->arguments;
if ($arguments) {
$arguments = ' ' . $arguments;
}
$result .= "@{$this->type}$arguments{$outputFormat->spaceBeforeOpeningBrace()}{";
$result .= $this->renderListContents($outputFormat);
$result .= '}';
$result .= $outputFormat->getAfterAtRuleBlock();
$result .= $outputFormat->getContentAfterAtRuleBlock();
return $result;
}

Expand Down
16 changes: 8 additions & 8 deletions src/OutputFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class OutputFormat
*
* @var string
*/
private $sBeforeAtRuleBlock = '';
private $contentBeforeAtRuleBlock = '';

/**
* @var string
*/
private $sAfterAtRuleBlock = '';
private $contentAfterAtRuleBlock = '';

/**
* This is what’s printed before and after the comma if a declaration block contains multiple selectors.
Expand Down Expand Up @@ -383,35 +383,35 @@ public function setSpaceBetweenBlocks(string $whitespace): self
/**
* @internal
*/
public function getBeforeAtRuleBlock(): string
public function getContentBeforeAtRuleBlock(): string
{
return $this->sBeforeAtRuleBlock;
return $this->contentBeforeAtRuleBlock;
}

/**
* @return $this fluent interface
*/
public function setBeforeAtRuleBlock(string $content): self
{
$this->sBeforeAtRuleBlock = $content;
$this->contentBeforeAtRuleBlock = $content;

return $this;
}

/**
* @internal
*/
public function getAfterAtRuleBlock(): string
public function getContentAfterAtRuleBlock(): string
{
return $this->sAfterAtRuleBlock;
return $this->contentAfterAtRuleBlock;
}

/**
* @return $this fluent interface
*/
public function setAfterAtRuleBlock(string $content): self
{
$this->sAfterAtRuleBlock = $content;
$this->contentAfterAtRuleBlock = $content;

return $this;
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Unit/OutputFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ public function setSpaceBetweenBlocksProvidesFluentInterface(): void
/**
* @test
*/
public function getBeforeAtRuleBlockInitiallyReturnsEmptyString(): void
public function getContentBeforeAtRuleBlockInitiallyReturnsEmptyString(): void
{
self::assertSame('', $this->subject->getBeforeAtRuleBlock());
self::assertSame('', $this->subject->getContentBeforeAtRuleBlock());
}

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

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

/**
Expand All @@ -336,9 +336,9 @@ public function setBeforeAtRuleBlockProvidesFluentInterface(): void
/**
* @test
*/
public function getAfterAtRuleBlockInitiallyReturnsEmptyString(): void
public function getContentAfterAtRuleBlockInitiallyReturnsEmptyString(): void
{
self::assertSame('', $this->subject->getAfterAtRuleBlock());
self::assertSame('', $this->subject->getContentAfterAtRuleBlock());
}

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

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

/**
Expand Down