Skip to content

Commit 845b457

Browse files
authored
[CLEANUP] Avoid Hungarian notation for outputFormat (#910)
Part of #756
1 parent a5d22be commit 845b457

19 files changed

+60
-60
lines changed

src/CSSList/AtRuleBlockList.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ public function __toString(): string
5555
return $this->render(new OutputFormat());
5656
}
5757

58-
public function render(OutputFormat $oOutputFormat): string
58+
public function render(OutputFormat $outputFormat): string
5959
{
60-
$sResult = $oOutputFormat->comments($this);
61-
$sResult .= $oOutputFormat->sBeforeAtRuleBlock;
60+
$sResult = $outputFormat->comments($this);
61+
$sResult .= $outputFormat->sBeforeAtRuleBlock;
6262
$sArgs = $this->sArgs;
6363
if ($sArgs) {
6464
$sArgs = ' ' . $sArgs;
6565
}
66-
$sResult .= "@{$this->type}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
67-
$sResult .= $this->renderListContents($oOutputFormat);
66+
$sResult .= "@{$this->type}$sArgs{$outputFormat->spaceBeforeOpeningBrace()}{";
67+
$sResult .= $this->renderListContents($outputFormat);
6868
$sResult .= '}';
69-
$sResult .= $oOutputFormat->sAfterAtRuleBlock;
69+
$sResult .= $outputFormat->sAfterAtRuleBlock;
7070
return $sResult;
7171
}
7272

src/CSSList/CSSList.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,16 +410,16 @@ public function __toString(): string
410410
/**
411411
* @return string
412412
*/
413-
protected function renderListContents(OutputFormat $oOutputFormat)
413+
protected function renderListContents(OutputFormat $outputFormat)
414414
{
415415
$result = '';
416416
$isFirst = true;
417-
$nextLevelFormat = $oOutputFormat;
417+
$nextLevelFormat = $outputFormat;
418418
if (!$this->isRootList()) {
419-
$nextLevelFormat = $oOutputFormat->nextLevel();
419+
$nextLevelFormat = $outputFormat->nextLevel();
420420
}
421421
foreach ($this->contents as $listItem) {
422-
$renderedCss = $oOutputFormat->safely(static function () use ($nextLevelFormat, $listItem): string {
422+
$renderedCss = $outputFormat->safely(static function () use ($nextLevelFormat, $listItem): string {
423423
return $listItem->render($nextLevelFormat);
424424
});
425425
if ($renderedCss === null) {
@@ -436,7 +436,7 @@ protected function renderListContents(OutputFormat $oOutputFormat)
436436

437437
if (!$isFirst) {
438438
// Had some output
439-
$result .= $oOutputFormat->spaceAfterBlocks();
439+
$result .= $outputFormat->spaceAfterBlocks();
440440
}
441441

442442
return $result;

src/CSSList/Document.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ public function getSelectorsBySpecificity($sSpecificitySearch = null): array
114114
/**
115115
* Overrides `render()` to make format argument optional.
116116
*/
117-
public function render(?OutputFormat $oOutputFormat = null): string
117+
public function render(?OutputFormat $outputFormat = null): string
118118
{
119-
if ($oOutputFormat === null) {
120-
$oOutputFormat = new OutputFormat();
119+
if ($outputFormat === null) {
120+
$outputFormat = new OutputFormat();
121121
}
122-
return $oOutputFormat->comments($this) . $this->renderListContents($oOutputFormat);
122+
return $outputFormat->comments($this) . $this->renderListContents($outputFormat);
123123
}
124124

125125
public function isRootList(): bool

src/CSSList/KeyFrame.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ public function __toString(): string
6666
return $this->render(new OutputFormat());
6767
}
6868

69-
public function render(OutputFormat $oOutputFormat): string
69+
public function render(OutputFormat $outputFormat): string
7070
{
71-
$sResult = $oOutputFormat->comments($this);
72-
$sResult .= "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
73-
$sResult .= $this->renderListContents($oOutputFormat);
71+
$sResult = $outputFormat->comments($this);
72+
$sResult .= "@{$this->vendorKeyFrame} {$this->animationName}{$outputFormat->spaceBeforeOpeningBrace()}{";
73+
$sResult .= $this->renderListContents($outputFormat);
7474
$sResult .= '}';
7575
return $sResult;
7676
}

src/Property/CSSNamespace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public function __toString(): string
6060
return $this->render(new OutputFormat());
6161
}
6262

63-
public function render(OutputFormat $oOutputFormat): string
63+
public function render(OutputFormat $outputFormat): string
6464
{
6565
return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
66-
. $this->mUrl->render($oOutputFormat) . ';';
66+
. $this->mUrl->render($outputFormat) . ';';
6767
}
6868

6969
/**

src/Property/Charset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public function __toString(): string
7777
return $this->render(new OutputFormat());
7878
}
7979

80-
public function render(OutputFormat $oOutputFormat): string
80+
public function render(OutputFormat $outputFormat): string
8181
{
82-
return "{$oOutputFormat->comments($this)}@charset {$this->oCharset->render($oOutputFormat)};";
82+
return "{$outputFormat->comments($this)}@charset {$this->oCharset->render($outputFormat)};";
8383
}
8484

8585
public function atRuleName(): string

src/Property/Import.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ public function __toString(): string
7878
return $this->render(new OutputFormat());
7979
}
8080

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

src/Renderable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Renderable
88
{
99
public function __toString(): string;
1010

11-
public function render(OutputFormat $oOutputFormat): string;
11+
public function render(OutputFormat $outputFormat): string;
1212

1313
/**
1414
* @return int<0, max>

src/Rule/Rule.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ public function __toString(): string
267267
return $this->render(new OutputFormat());
268268
}
269269

270-
public function render(OutputFormat $oOutputFormat): string
270+
public function render(OutputFormat $outputFormat): string
271271
{
272-
$sResult = "{$oOutputFormat->comments($this)}{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
272+
$sResult = "{$outputFormat->comments($this)}{$this->sRule}:{$outputFormat->spaceAfterRuleName()}";
273273
if ($this->mValue instanceof Value) { // Can also be a ValueList
274-
$sResult .= $this->mValue->render($oOutputFormat);
274+
$sResult .= $this->mValue->render($outputFormat);
275275
} else {
276276
$sResult .= $this->mValue;
277277
}

src/RuleSet/AtRuleSet.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ public function __toString(): string
5858
return $this->render(new OutputFormat());
5959
}
6060

61-
public function render(OutputFormat $oOutputFormat): string
61+
public function render(OutputFormat $outputFormat): string
6262
{
63-
$sResult = $oOutputFormat->comments($this);
63+
$sResult = $outputFormat->comments($this);
6464
$sArgs = $this->sArgs;
6565
if ($sArgs) {
6666
$sArgs = ' ' . $sArgs;
6767
}
68-
$sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
69-
$sResult .= $this->renderRules($oOutputFormat);
68+
$sResult .= "@{$this->sType}$sArgs{$outputFormat->spaceBeforeOpeningBrace()}{";
69+
$sResult .= $this->renderRules($outputFormat);
7070
$sResult .= '}';
7171
return $sResult;
7272
}

src/RuleSet/DeclarationBlock.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,23 @@ public function __toString(): string
159159
/**
160160
* @throws OutputException
161161
*/
162-
public function render(OutputFormat $oOutputFormat): string
162+
public function render(OutputFormat $outputFormat): string
163163
{
164-
$sResult = $oOutputFormat->comments($this);
164+
$sResult = $outputFormat->comments($this);
165165
if (\count($this->aSelectors) === 0) {
166166
// If all the selectors have been removed, this declaration block becomes invalid
167167
throw new OutputException('Attempt to print declaration block with missing selector', $this->lineNumber);
168168
}
169-
$sResult .= $oOutputFormat->sBeforeDeclarationBlock;
170-
$sResult .= $oOutputFormat->implode(
171-
$oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(),
169+
$sResult .= $outputFormat->sBeforeDeclarationBlock;
170+
$sResult .= $outputFormat->implode(
171+
$outputFormat->spaceBeforeSelectorSeparator() . ',' . $outputFormat->spaceAfterSelectorSeparator(),
172172
$this->aSelectors
173173
);
174-
$sResult .= $oOutputFormat->sAfterDeclarationBlockSelectors;
175-
$sResult .= $oOutputFormat->spaceBeforeOpeningBrace() . '{';
176-
$sResult .= $this->renderRules($oOutputFormat);
174+
$sResult .= $outputFormat->sAfterDeclarationBlockSelectors;
175+
$sResult .= $outputFormat->spaceBeforeOpeningBrace() . '{';
176+
$sResult .= $this->renderRules($outputFormat);
177177
$sResult .= '}';
178-
$sResult .= $oOutputFormat->sAfterDeclarationBlock;
178+
$sResult .= $outputFormat->sAfterDeclarationBlock;
179179
return $sResult;
180180
}
181181
}

src/RuleSet/RuleSet.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@ public function __toString(): string
263263
/**
264264
* @return string
265265
*/
266-
protected function renderRules(OutputFormat $oOutputFormat)
266+
protected function renderRules(OutputFormat $outputFormat)
267267
{
268268
$sResult = '';
269269
$bIsFirst = true;
270-
$oNextLevel = $oOutputFormat->nextLevel();
270+
$oNextLevel = $outputFormat->nextLevel();
271271
foreach ($this->aRules as $aRules) {
272272
foreach ($aRules as $rule) {
273273
$sRendered = $oNextLevel->safely(static function () use ($rule, $oNextLevel): string {
@@ -288,10 +288,10 @@ protected function renderRules(OutputFormat $oOutputFormat)
288288

289289
if (!$bIsFirst) {
290290
// Had some output
291-
$sResult .= $oOutputFormat->spaceAfterRules();
291+
$sResult .= $outputFormat->spaceAfterRules();
292292
}
293293

294-
return $oOutputFormat->removeLastSemicolon($sResult);
294+
return $outputFormat->removeLastSemicolon($sResult);
295295
}
296296

297297
/**

src/Value/CSSFunction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ public function __toString(): string
108108
return $this->render(new OutputFormat());
109109
}
110110

111-
public function render(OutputFormat $oOutputFormat): string
111+
public function render(OutputFormat $outputFormat): string
112112
{
113-
$aArguments = parent::render($oOutputFormat);
113+
$aArguments = parent::render($outputFormat);
114114
return "{$this->sName}({$aArguments})";
115115
}
116116
}

src/Value/CSSString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public function __toString(): string
9393
return $this->render(new OutputFormat());
9494
}
9595

96-
public function render(OutputFormat $oOutputFormat): string
96+
public function render(OutputFormat $outputFormat): string
9797
{
9898
$sString = \addslashes($this->sString);
9999
$sString = \str_replace("\n", '\\A', $sString);
100-
return $oOutputFormat->getStringQuotingType() . $sString . $oOutputFormat->getStringQuotingType();
100+
return $outputFormat->getStringQuotingType() . $sString . $outputFormat->getStringQuotingType();
101101
}
102102
}

src/Value/CalcRuleValueList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public function __construct($lineNumber = 0)
1616
parent::__construct(',', $lineNumber);
1717
}
1818

19-
public function render(OutputFormat $oOutputFormat): string
19+
public function render(OutputFormat $outputFormat): string
2020
{
21-
return $oOutputFormat->implode(' ', $this->aComponents);
21+
return $outputFormat->implode(' ', $this->aComponents);
2222
}
2323
}

src/Value/LineName.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __toString(): string
5252
return $this->render(new OutputFormat());
5353
}
5454

55-
public function render(OutputFormat $oOutputFormat): string
55+
public function render(OutputFormat $outputFormat): string
5656
{
5757
return '[' . parent::render(OutputFormat::createCompact()) . ']';
5858
}

src/Value/Size.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function __toString(): string
213213
return $this->render(new OutputFormat());
214214
}
215215

216-
public function render(OutputFormat $oOutputFormat): string
216+
public function render(OutputFormat $outputFormat): string
217217
{
218218
$l = \localeconv();
219219
$sPoint = \preg_quote($l['decimal_point'], '/');

src/Value/URL.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function __toString(): string
7979
return $this->render(new OutputFormat());
8080
}
8181

82-
public function render(OutputFormat $oOutputFormat): string
82+
public function render(OutputFormat $outputFormat): string
8383
{
84-
return "url({$this->oURL->render($oOutputFormat)})";
84+
return "url({$this->oURL->render($outputFormat)})";
8585
}
8686
}

src/Value/ValueList.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public function __toString(): string
8888
return $this->render(new OutputFormat());
8989
}
9090

91-
public function render(OutputFormat $oOutputFormat): string
91+
public function render(OutputFormat $outputFormat): string
9292
{
93-
return $oOutputFormat->implode(
94-
$oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
95-
. $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator),
93+
return $outputFormat->implode(
94+
$outputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
95+
. $outputFormat->spaceAfterListArgumentSeparator($this->sSeparator),
9696
$this->aComponents
9797
);
9898
}

0 commit comments

Comments
 (0)