@@ -67,30 +67,30 @@ class Selector
67
67
/**
68
68
* @var string
69
69
*/
70
- private $ sSelector ;
70
+ private $ selector ;
71
71
72
72
/**
73
73
* @var int|null
74
74
*/
75
75
private $ iSpecificity ;
76
76
77
77
/**
78
- * @param string $sSelector
78
+ * @param string $selector
79
79
*
80
80
* @return bool
81
81
*/
82
- public static function isValid ($ sSelector )
82
+ public static function isValid ($ selector )
83
83
{
84
- return \preg_match (static ::SELECTOR_VALIDATION_RX , $ sSelector );
84
+ return \preg_match (static ::SELECTOR_VALIDATION_RX , $ selector );
85
85
}
86
86
87
87
/**
88
- * @param string $sSelector
88
+ * @param string $selector
89
89
* @param bool $bCalculateSpecificity
90
90
*/
91
- public function __construct ($ sSelector , $ bCalculateSpecificity = false )
91
+ public function __construct ($ selector , $ bCalculateSpecificity = false )
92
92
{
93
- $ this ->setSelector ($ sSelector );
93
+ $ this ->setSelector ($ selector );
94
94
if ($ bCalculateSpecificity ) {
95
95
$ this ->getSpecificity ();
96
96
}
@@ -101,15 +101,15 @@ public function __construct($sSelector, $bCalculateSpecificity = false)
101
101
*/
102
102
public function getSelector ()
103
103
{
104
- return $ this ->sSelector ;
104
+ return $ this ->selector ;
105
105
}
106
106
107
107
/**
108
- * @param string $sSelector
108
+ * @param string $selector
109
109
*/
110
- public function setSelector ($ sSelector ): void
110
+ public function setSelector ($ selector ): void
111
111
{
112
- $ this ->sSelector = \trim ($ sSelector );
112
+ $ this ->selector = \trim ($ selector );
113
113
$ this ->iSpecificity = null ;
114
114
}
115
115
@@ -127,9 +127,9 @@ public function getSpecificity()
127
127
$ a = 0 ;
128
128
/// @todo should exclude \# as well as "#"
129
129
$ 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 );
133
133
$ this ->iSpecificity = ($ a * 1000 ) + ($ b * 100 ) + ($ c * 10 ) + $ d ;
134
134
}
135
135
return $ this ->iSpecificity ;
0 commit comments