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
12 changes: 6 additions & 6 deletions src/CSSList/AtRuleBlockList.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$sResult = $oOutputFormat->comments($this);
$sResult .= $oOutputFormat->sBeforeAtRuleBlock;
$sResult = $outputFormat->comments($this);
$sResult .= $outputFormat->sBeforeAtRuleBlock;
$sArgs = $this->sArgs;
if ($sArgs) {
$sArgs = ' ' . $sArgs;
}
$sResult .= "@{$this->type}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
$sResult .= $this->renderListContents($oOutputFormat);
$sResult .= "@{$this->type}$sArgs{$outputFormat->spaceBeforeOpeningBrace()}{";
$sResult .= $this->renderListContents($outputFormat);
$sResult .= '}';
$sResult .= $oOutputFormat->sAfterAtRuleBlock;
$sResult .= $outputFormat->sAfterAtRuleBlock;
return $sResult;
}

Expand Down
10 changes: 5 additions & 5 deletions src/CSSList/CSSList.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,16 @@ public function __toString(): string
/**
* @return string
*/
protected function renderListContents(OutputFormat $oOutputFormat)
protected function renderListContents(OutputFormat $outputFormat)
{
$result = '';
$isFirst = true;
$nextLevelFormat = $oOutputFormat;
$nextLevelFormat = $outputFormat;
if (!$this->isRootList()) {
$nextLevelFormat = $oOutputFormat->nextLevel();
$nextLevelFormat = $outputFormat->nextLevel();
}
foreach ($this->contents as $listItem) {
$renderedCss = $oOutputFormat->safely(static function () use ($nextLevelFormat, $listItem): string {
$renderedCss = $outputFormat->safely(static function () use ($nextLevelFormat, $listItem): string {
return $listItem->render($nextLevelFormat);
});
if ($renderedCss === null) {
Expand All @@ -436,7 +436,7 @@ protected function renderListContents(OutputFormat $oOutputFormat)

if (!$isFirst) {
// Had some output
$result .= $oOutputFormat->spaceAfterBlocks();
$result .= $outputFormat->spaceAfterBlocks();
}

return $result;
Expand Down
8 changes: 4 additions & 4 deletions src/CSSList/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ public function getSelectorsBySpecificity($sSpecificitySearch = null): array
/**
* Overrides `render()` to make format argument optional.
*/
public function render(?OutputFormat $oOutputFormat = null): string
public function render(?OutputFormat $outputFormat = null): string
{
if ($oOutputFormat === null) {
$oOutputFormat = new OutputFormat();
if ($outputFormat === null) {
$outputFormat = new OutputFormat();
}
return $oOutputFormat->comments($this) . $this->renderListContents($oOutputFormat);
return $outputFormat->comments($this) . $this->renderListContents($outputFormat);
}

public function isRootList(): bool
Expand Down
8 changes: 4 additions & 4 deletions src/CSSList/KeyFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$sResult = $oOutputFormat->comments($this);
$sResult .= "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
$sResult .= $this->renderListContents($oOutputFormat);
$sResult = $outputFormat->comments($this);
$sResult .= "@{$this->vendorKeyFrame} {$this->animationName}{$outputFormat->spaceBeforeOpeningBrace()}{";
$sResult .= $this->renderListContents($outputFormat);
$sResult .= '}';
return $sResult;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Property/CSSNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
. $this->mUrl->render($oOutputFormat) . ';';
. $this->mUrl->render($outputFormat) . ';';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Property/Charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
return "{$oOutputFormat->comments($this)}@charset {$this->oCharset->render($oOutputFormat)};";
return "{$outputFormat->comments($this)}@charset {$this->oCharset->render($outputFormat)};";
}

public function atRuleName(): string
Expand Down
4 changes: 2 additions & 2 deletions src/Property/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
return $oOutputFormat->comments($this) . '@import ' . $this->location->render($oOutputFormat)
return $outputFormat->comments($this) . '@import ' . $this->location->render($outputFormat)
. ($this->mediaQuery === null ? '' : ' ' . $this->mediaQuery) . ';';
}

Expand Down
2 changes: 1 addition & 1 deletion src/Renderable.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Renderable
{
public function __toString(): string;

public function render(OutputFormat $oOutputFormat): string;
public function render(OutputFormat $outputFormat): string;

/**
* @return int<0, max>
Expand Down
6 changes: 3 additions & 3 deletions src/Rule/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$sResult = "{$oOutputFormat->comments($this)}{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
$sResult = "{$outputFormat->comments($this)}{$this->sRule}:{$outputFormat->spaceAfterRuleName()}";
if ($this->mValue instanceof Value) { // Can also be a ValueList
$sResult .= $this->mValue->render($oOutputFormat);
$sResult .= $this->mValue->render($outputFormat);
} else {
$sResult .= $this->mValue;
}
Expand Down
8 changes: 4 additions & 4 deletions src/RuleSet/AtRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$sResult = $oOutputFormat->comments($this);
$sResult = $outputFormat->comments($this);
$sArgs = $this->sArgs;
if ($sArgs) {
$sArgs = ' ' . $sArgs;
}
$sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
$sResult .= $this->renderRules($oOutputFormat);
$sResult .= "@{$this->sType}$sArgs{$outputFormat->spaceBeforeOpeningBrace()}{";
$sResult .= $this->renderRules($outputFormat);
$sResult .= '}';
return $sResult;
}
Expand Down
18 changes: 9 additions & 9 deletions src/RuleSet/DeclarationBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,23 @@ public function __toString(): string
/**
* @throws OutputException
*/
public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$sResult = $oOutputFormat->comments($this);
$sResult = $outputFormat->comments($this);
if (\count($this->aSelectors) === 0) {
// If all the selectors have been removed, this declaration block becomes invalid
throw new OutputException('Attempt to print declaration block with missing selector', $this->lineNumber);
}
$sResult .= $oOutputFormat->sBeforeDeclarationBlock;
$sResult .= $oOutputFormat->implode(
$oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(),
$sResult .= $outputFormat->sBeforeDeclarationBlock;
$sResult .= $outputFormat->implode(
$outputFormat->spaceBeforeSelectorSeparator() . ',' . $outputFormat->spaceAfterSelectorSeparator(),
$this->aSelectors
);
$sResult .= $oOutputFormat->sAfterDeclarationBlockSelectors;
$sResult .= $oOutputFormat->spaceBeforeOpeningBrace() . '{';
$sResult .= $this->renderRules($oOutputFormat);
$sResult .= $outputFormat->sAfterDeclarationBlockSelectors;
$sResult .= $outputFormat->spaceBeforeOpeningBrace() . '{';
$sResult .= $this->renderRules($outputFormat);
$sResult .= '}';
$sResult .= $oOutputFormat->sAfterDeclarationBlock;
$sResult .= $outputFormat->sAfterDeclarationBlock;
return $sResult;
}
}
8 changes: 4 additions & 4 deletions src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ public function __toString(): string
/**
* @return string
*/
protected function renderRules(OutputFormat $oOutputFormat)
protected function renderRules(OutputFormat $outputFormat)
{
$sResult = '';
$bIsFirst = true;
$oNextLevel = $oOutputFormat->nextLevel();
$oNextLevel = $outputFormat->nextLevel();
foreach ($this->aRules as $aRules) {
foreach ($aRules as $rule) {
$sRendered = $oNextLevel->safely(static function () use ($rule, $oNextLevel): string {
Expand All @@ -288,10 +288,10 @@ protected function renderRules(OutputFormat $oOutputFormat)

if (!$bIsFirst) {
// Had some output
$sResult .= $oOutputFormat->spaceAfterRules();
$sResult .= $outputFormat->spaceAfterRules();
}

return $oOutputFormat->removeLastSemicolon($sResult);
return $outputFormat->removeLastSemicolon($sResult);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Value/CSSFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$aArguments = parent::render($oOutputFormat);
$aArguments = parent::render($outputFormat);
return "{$this->sName}({$aArguments})";
}
}
4 changes: 2 additions & 2 deletions src/Value/CSSString.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$sString = \addslashes($this->sString);
$sString = \str_replace("\n", '\\A', $sString);
return $oOutputFormat->getStringQuotingType() . $sString . $oOutputFormat->getStringQuotingType();
return $outputFormat->getStringQuotingType() . $sString . $outputFormat->getStringQuotingType();
}
}
4 changes: 2 additions & 2 deletions src/Value/CalcRuleValueList.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public function __construct($lineNumber = 0)
parent::__construct(',', $lineNumber);
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
return $oOutputFormat->implode(' ', $this->aComponents);
return $outputFormat->implode(' ', $this->aComponents);
}
}
2 changes: 1 addition & 1 deletion src/Value/LineName.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
return '[' . parent::render(OutputFormat::createCompact()) . ']';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Value/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
$l = \localeconv();
$sPoint = \preg_quote($l['decimal_point'], '/');
Expand Down
4 changes: 2 additions & 2 deletions src/Value/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
return "url({$this->oURL->render($oOutputFormat)})";
return "url({$this->oURL->render($outputFormat)})";
}
}
8 changes: 4 additions & 4 deletions src/Value/ValueList.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public function __toString(): string
return $this->render(new OutputFormat());
}

public function render(OutputFormat $oOutputFormat): string
public function render(OutputFormat $outputFormat): string
{
return $oOutputFormat->implode(
$oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
. $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator),
return $outputFormat->implode(
$outputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
. $outputFormat->spaceAfterListArgumentSeparator($this->sSeparator),
$this->aComponents
);
}
Expand Down