Skip to content

Commit aaa0dba

Browse files
committed
Shorten some names
1 parent 5439d4c commit aaa0dba

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Property/Selector/SpecificityCalculator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,23 @@ final class SpecificityCalculator
5353
/**
5454
* @var array<string, int<0, max>>
5555
*/
56-
private static $specificityCache = [];
56+
private static $cache = [];
5757

5858
/**
5959
* @return int<0, max>
6060
*/
61-
public static function calculateSpecificity(string $selector): int
61+
public static function calculate(string $selector): int
6262
{
63-
if (!isset(self::$specificityCache[$selector])) {
63+
if (!isset(self::$cache[$selector])) {
6464
$a = 0;
6565
/// @todo should exclude \# as well as "#"
6666
$aMatches = null;
6767
$b = \substr_count($selector, '#');
6868
$c = \preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $selector, $aMatches);
6969
$d = \preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $selector, $aMatches);
70-
self::$specificityCache[$selector] = ($a * 1000) + ($b * 100) + ($c * 10) + $d;
70+
self::$cache[$selector] = ($a * 1000) + ($b * 100) + ($c * 10) + $d;
7171
}
7272

73-
return self::$specificityCache[$selector];
73+
return self::$cache[$selector];
7474
}
7575
}

tests/Unit/Property/Selector/SpecificityCalculatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public static function provideSelectorsAndSpecificities(): array
3636
*
3737
* @dataProvider provideSelectorsAndSpecificities
3838
*/
39-
public function calculateSpecificityReturnsSpecificityForProvidedSelector(
39+
public function calculateReturnsSpecificityForProvidedSelector(
4040
string $selector,
4141
int $expectedSpecificity
4242
): void {
43-
self::assertSame($expectedSpecificity, SpecificityCalculator::calculateSpecificity($selector));
43+
self::assertSame($expectedSpecificity, SpecificityCalculator::calculate($selector));
4444
}
4545
}

0 commit comments

Comments
 (0)