File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,30 @@ class Selector
6060 )$
6161 /ux ' ;
6262
63+ /**
64+ * @var string
65+ */
6366 private $ sSelector ;
6467
68+ /**
69+ * @var int|null
70+ */
6571 private $ iSpecificity ;
6672
73+ /**
74+ * @param string $sSelector
75+ *
76+ * @return bool
77+ */
6778 public static function isValid ($ sSelector )
6879 {
6980 return preg_match (static ::SELECTOR_VALIDATION_RX , $ sSelector );
7081 }
7182
83+ /**
84+ * @param string $sSelector
85+ * @param bool $bCalculateSpecificity
86+ */
7287 public function __construct ($ sSelector , $ bCalculateSpecificity = false )
7388 {
7489 $ this ->setSelector ($ sSelector );
@@ -77,22 +92,36 @@ public function __construct($sSelector, $bCalculateSpecificity = false)
7792 }
7893 }
7994
95+ /**
96+ * @return string
97+ */
8098 public function getSelector ()
8199 {
82100 return $ this ->sSelector ;
83101 }
84102
103+ /**
104+ * @param string $sSelector
105+ *
106+ * @return void
107+ */
85108 public function setSelector ($ sSelector )
86109 {
87110 $ this ->sSelector = trim ($ sSelector );
88111 $ this ->iSpecificity = null ;
89112 }
90113
114+ /**
115+ * @return string
116+ */
91117 public function __toString ()
92118 {
93119 return $ this ->getSelector ();
94120 }
95121
122+ /**
123+ * @return int
124+ */
96125 public function getSpecificity ()
97126 {
98127 if ($ this ->iSpecificity === null ) {
You can’t perform that action at this time.
0 commit comments