Skip to content

Commit 0cf4a76

Browse files
authored
[CLEANUP] Avoid Hungarian notation for charset (#948)
Part of #756
1 parent 4526202 commit 0cf4a76

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/Parsing/ParserState.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ParserState
4444
*
4545
* @var string
4646
*/
47-
private $sCharset;
47+
private $charset;
4848

4949
/**
5050
* @var int
@@ -71,11 +71,11 @@ public function __construct($text, Settings $parserSettings, $lineNumber = 1)
7171
/**
7272
* Sets the charset to be used if the CSS does not contain an `@charset` declaration.
7373
*
74-
* @param string $sCharset
74+
* @param string $charset
7575
*/
76-
public function setCharset($sCharset): void
76+
public function setCharset($charset): void
7777
{
78-
$this->sCharset = $sCharset;
78+
$this->charset = $charset;
7979
$this->characters = $this->strsplit($this->text);
8080
if (\is_array($this->characters)) {
8181
$this->iLength = \count($this->characters);
@@ -195,7 +195,7 @@ public function parseCharacter($bIsForIdentifier)
195195
$sUtf32 .= \chr($iUnicode & 0xff);
196196
$iUnicode = $iUnicode >> 8;
197197
}
198-
return \iconv('utf-32le', $this->sCharset, $sUtf32);
198+
return \iconv('utf-32le', $this->charset, $sUtf32);
199199
}
200200
if ($bIsForIdentifier) {
201201
$peek = \ord($this->peek());
@@ -431,7 +431,7 @@ public function backtrack($iAmount): void
431431
public function strlen($sString): int
432432
{
433433
if ($this->parserSettings->bMultibyteSupport) {
434-
return \mb_strlen($sString, $this->sCharset);
434+
return \mb_strlen($sString, $this->charset);
435435
} else {
436436
return \strlen($sString);
437437
}
@@ -464,7 +464,7 @@ private function substr($iStart, $iLength): string
464464
private function strtolower($sString): string
465465
{
466466
if ($this->parserSettings->bMultibyteSupport) {
467-
return \mb_strtolower($sString, $this->sCharset);
467+
return \mb_strtolower($sString, $this->charset);
468468
} else {
469469
return \strtolower($sString);
470470
}
@@ -478,13 +478,13 @@ private function strtolower($sString): string
478478
private function strsplit($sString)
479479
{
480480
if ($this->parserSettings->bMultibyteSupport) {
481-
if ($this->streql($this->sCharset, 'utf-8')) {
481+
if ($this->streql($this->charset, 'utf-8')) {
482482
return \preg_split('//u', $sString, -1, PREG_SPLIT_NO_EMPTY);
483483
} else {
484-
$iLength = \mb_strlen($sString, $this->sCharset);
484+
$iLength = \mb_strlen($sString, $this->charset);
485485
$result = [];
486486
for ($i = 0; $i < $iLength; ++$i) {
487-
$result[] = \mb_substr($sString, $i, 1, $this->sCharset);
487+
$result[] = \mb_substr($sString, $i, 1, $this->charset);
488488
}
489489
return $result;
490490
}
@@ -507,7 +507,7 @@ private function strsplit($sString)
507507
private function strpos($sString, $sNeedle, $iOffset)
508508
{
509509
if ($this->parserSettings->bMultibyteSupport) {
510-
return \mb_strpos($sString, $sNeedle, $iOffset, $this->sCharset);
510+
return \mb_strpos($sString, $sNeedle, $iOffset, $this->charset);
511511
} else {
512512
return \strpos($sString, $sNeedle, $iOffset);
513513
}

src/Property/Charset.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ public function getLineNo(): int
5555
}
5656

5757
/**
58-
* @param string|CSSString $sCharset
58+
* @param string|CSSString $charset
5959
*/
60-
public function setCharset($sCharset): void
60+
public function setCharset($charset): void
6161
{
62-
$sCharset = $sCharset instanceof CSSString ? $sCharset : new CSSString($sCharset);
63-
$this->oCharset = $sCharset;
62+
$charset = $charset instanceof CSSString ? $charset : new CSSString($charset);
63+
$this->oCharset = $charset;
6464
}
6565

6666
/**

0 commit comments

Comments
 (0)