@@ -16,6 +16,9 @@ discard block |
||
| 16 | 16 | private $filePath; |
| 17 | 17 | private $import = []; |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param string $tss |
|
| 21 | + */ |
|
| 19 | 22 | public function __construct($tss, CssToXpath $xPath, Value $valueParser, \Transphporm\TSSCache $cache, \Transphporm\FilePath $filePath) { |
| 20 | 23 | $this->cache = $cache; |
| 21 | 24 | $this->xPath = $xPath; |
@@ -42,6 +45,9 @@ discard block |
||
| 42 | 45 | return $this->cache->write($this->file, $rules, $this->import); |
| 43 | 46 | } |
| 44 | 47 | |
| 48 | + /** |
|
| 49 | + * @param integer $indexStart |
|
| 50 | + */ |
|
| 45 | 51 | private function parseTokens($indexStart) { |
| 46 | 52 | $this->rules = []; |
| 47 | 53 | foreach (new TokenFilterIterator($this->tss, [Tokenizer::WHITESPACE]) as $token) { |
@@ -66,6 +72,9 @@ discard block |
||
| 66 | 72 | if (empty($rules) && count($this->tss) > 0) throw new \Exception('No TSS rules parsed'); |
| 67 | 73 | } |
| 68 | 74 | |
| 75 | + /** |
|
| 76 | + * @param integer $index |
|
| 77 | + */ |
|
| 69 | 78 | private function CssToRules($selector, $index, $properties, $line) { |
| 70 | 79 | $parts = $selector->trim()->splitOnToken(Tokenizer::ARG); |
| 71 | 80 | $rules = []; |
@@ -89,6 +98,9 @@ discard block |
||
| 89 | 98 | return $rules; |
| 90 | 99 | } |
| 91 | 100 | |
| 101 | + /** |
|
| 102 | + * @param integer $indexStart |
|
| 103 | + */ |
|
| 92 | 104 | private function processingInstructions($token, $indexStart) { |
| 93 | 105 | if ($token['type'] !== Tokenizer::AT_SIGN) return false; |
| 94 | 106 | $tokens = $this->tss->from(Tokenizer::AT_SIGN, false)->to(Tokenizer::SEMI_COLON, false); |
@@ -117,6 +129,10 @@ discard block |
||
| 117 | 129 | return ($a->depth < $b->depth) ? -1 : 1; |
| 118 | 130 | } |
| 119 | 131 | |
| 132 | + /** |
|
| 133 | + * @param string $open |
|
| 134 | + * @param string $close |
|
| 135 | + */ |
|
| 120 | 136 | private function stripComments($str, $open, $close) { |
| 121 | 137 | $pos = 0; |
| 122 | 138 | while (($pos = strpos($str, $open, $pos)) !== false) { |