Skip to content

Commit ce26af6

Browse files
authored
[CLEANUP] Avoid Hungarian notation for selector (#986)
Part of #756
1 parent 6ff4aa5 commit ce26af6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/Property/Selector.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,30 @@ class Selector
6767
/**
6868
* @var string
6969
*/
70-
private $sSelector;
70+
private $selector;
7171

7272
/**
7373
* @var int|null
7474
*/
7575
private $iSpecificity;
7676

7777
/**
78-
* @param string $sSelector
78+
* @param string $selector
7979
*
8080
* @return bool
8181
*/
82-
public static function isValid($sSelector)
82+
public static function isValid($selector)
8383
{
84-
return \preg_match(static::SELECTOR_VALIDATION_RX, $sSelector);
84+
return \preg_match(static::SELECTOR_VALIDATION_RX, $selector);
8585
}
8686

8787
/**
88-
* @param string $sSelector
88+
* @param string $selector
8989
* @param bool $bCalculateSpecificity
9090
*/
91-
public function __construct($sSelector, $bCalculateSpecificity = false)
91+
public function __construct($selector, $bCalculateSpecificity = false)
9292
{
93-
$this->setSelector($sSelector);
93+
$this->setSelector($selector);
9494
if ($bCalculateSpecificity) {
9595
$this->getSpecificity();
9696
}
@@ -101,15 +101,15 @@ public function __construct($sSelector, $bCalculateSpecificity = false)
101101
*/
102102
public function getSelector()
103103
{
104-
return $this->sSelector;
104+
return $this->selector;
105105
}
106106

107107
/**
108-
* @param string $sSelector
108+
* @param string $selector
109109
*/
110-
public function setSelector($sSelector): void
110+
public function setSelector($selector): void
111111
{
112-
$this->sSelector = \trim($sSelector);
112+
$this->selector = \trim($selector);
113113
$this->iSpecificity = null;
114114
}
115115

@@ -127,9 +127,9 @@ public function getSpecificity()
127127
$a = 0;
128128
/// @todo should exclude \# as well as "#"
129129
$aMatches = null;
130-
$b = \substr_count($this->sSelector, '#');
131-
$c = \preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->sSelector, $aMatches);
132-
$d = \preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->sSelector, $aMatches);
130+
$b = \substr_count($this->selector, '#');
131+
$c = \preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->selector, $aMatches);
132+
$d = \preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->selector, $aMatches);
133133
$this->iSpecificity = ($a * 1000) + ($b * 100) + ($c * 10) + $d;
134134
}
135135
return $this->iSpecificity;

0 commit comments

Comments
 (0)