@@ -13,6 +13,9 @@ discard block |
||
| 13 | 13 | private $xPath; |
| 14 | 14 | private $tokenizer; |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $tss |
|
| 18 | + */ |
|
| 16 | 19 | public function __construct($tss, $baseDir, CssToXpath $xPath, Value $valueParser) { |
| 17 | 20 | $this->tss = $this->stripComments($tss, '//', "\n"); |
| 18 | 21 | $this->tss = $this->stripComments($this->tss, '/*', '*/'); |
@@ -44,6 +47,9 @@ discard block |
||
| 44 | 47 | return $rules; |
| 45 | 48 | } |
| 46 | 49 | |
| 50 | + /** |
|
| 51 | + * @param integer $index |
|
| 52 | + */ |
|
| 47 | 53 | private function CssToRules($selector, $index, $properties) { |
| 48 | 54 | $parts = $selector->trim()->splitOnToken(Tokenizer::ARG); |
| 49 | 55 | $rules = []; |
@@ -67,6 +73,9 @@ discard block |
||
| 67 | 73 | return $rules; |
| 68 | 74 | } |
| 69 | 75 | |
| 76 | + /** |
|
| 77 | + * @param integer $indexStart |
|
| 78 | + */ |
|
| 70 | 79 | private function processingInstructions($token, $indexStart) { |
| 71 | 80 | if ($token['type'] !== Tokenizer::AT_SIGN) return false; |
| 72 | 81 | $tokens = $this->tss->from(Tokenizer::AT_SIGN, false)->to(Tokenizer::SEMI_COLON, false); |
@@ -90,6 +99,10 @@ discard block |
||
| 90 | 99 | return ($a->depth < $b->depth) ? -1 : 1; |
| 91 | 100 | } |
| 92 | 101 | |
| 102 | + /** |
|
| 103 | + * @param string $open |
|
| 104 | + * @param string $close |
|
| 105 | + */ |
|
| 93 | 106 | private function stripComments($str, $open, $close) { |
| 94 | 107 | $pos = 0; |
| 95 | 108 | while (($pos = strpos($str, $open, $pos)) !== false) { |