From 7bfe1d30be7b8efa5edb67ca3e2e6193ef83374f Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Tue, 25 Feb 2025 09:45:01 +0100 Subject: [PATCH] [CLEANUP] Avoid Hungarian notation in `Selector` Part of #756 --- src/Property/Selector.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Property/Selector.php b/src/Property/Selector.php index 3b1c05731..c7226d3c7 100644 --- a/src/Property/Selector.php +++ b/src/Property/Selector.php @@ -72,7 +72,7 @@ class Selector /** * @var int|null */ - private $iSpecificity; + private $specificity; /** * @param string $selector @@ -86,12 +86,12 @@ public static function isValid($selector) /** * @param string $selector - * @param bool $bCalculateSpecificity + * @param bool $calculateSpecificity */ - public function __construct($selector, $bCalculateSpecificity = false) + public function __construct($selector, $calculateSpecificity = false) { $this->setSelector($selector); - if ($bCalculateSpecificity) { + if ($calculateSpecificity) { $this->getSpecificity(); } } @@ -110,7 +110,7 @@ public function getSelector() public function setSelector($selector): void { $this->selector = \trim($selector); - $this->iSpecificity = null; + $this->specificity = null; } public function __toString(): string @@ -123,15 +123,15 @@ public function __toString(): string */ public function getSpecificity() { - if ($this->iSpecificity === null) { + if ($this->specificity === null) { $a = 0; /// @todo should exclude \# as well as "#" $aMatches = null; $b = \substr_count($this->selector, '#'); $c = \preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->selector, $aMatches); $d = \preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->selector, $aMatches); - $this->iSpecificity = ($a * 1000) + ($b * 100) + ($c * 10) + $d; + $this->specificity = ($a * 1000) + ($b * 100) + ($c * 10) + $d; } - return $this->iSpecificity; + return $this->specificity; } }