@@ -62,6 +62,10 @@ discard block |
||
| 62 | 62 | return (object) $result; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | + /** |
|
| 66 | + * @param Template $template |
|
| 67 | + * @param Config $config |
|
| 68 | + */ |
|
| 65 | 69 | private function processRules($template, $config) { |
| 66 | 70 | $rules = $this->getRules($template, $config); |
| 67 | 71 | |
@@ -71,6 +75,10 @@ discard block |
||
| 71 | 75 | } |
| 72 | 76 | |
| 73 | 77 | //Add a postprocessing hook. This cleans up anything transphporm has added to the markup which needs to be removed |
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @param Template $template |
|
| 81 | + */ |
|
| 74 | 82 | private function doPostProcessing($template) { |
| 75 | 83 | $template->addHook('//*[@transphporm]', new Hook\PostProcess()); |
| 76 | 84 | return $template; |
@@ -7,6 +7,9 @@ |
||
| 7 | 7 | $this->templateFunction = $templateFunction; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | + /** |
|
| 11 | + * @param string $val |
|
| 12 | + */ |
|
| 10 | 13 | public function html($val) { |
| 11 | 14 | return $this->templateFunction->run(['<template>' . $val . '</template>']); |
| 12 | 15 | } |
@@ -39,6 +39,9 @@ discard block |
||
| 39 | 39 | return $this->cache->write($this->file, $rules, $this->import); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | + /** |
|
| 43 | + * @param integer $indexStart |
|
| 44 | + */ |
|
| 42 | 45 | private function parseTokens($indexStart) { |
| 43 | 46 | $this->rules = []; |
| 44 | 47 | foreach (new TokenFilterIterator($this->tss, [Tokenizer::WHITESPACE]) as $token) { |
@@ -63,6 +66,9 @@ discard block |
||
| 63 | 66 | if (empty($rules) && count($this->tss) > 0) throw new \Exception('No TSS rules parsed'); |
| 64 | 67 | } |
| 65 | 68 | |
| 69 | + /** |
|
| 70 | + * @param integer $index |
|
| 71 | + */ |
|
| 66 | 72 | private function CssToRules($selector, $index, $properties, $line) { |
| 67 | 73 | $parts = $selector->trim()->splitOnToken(Tokenizer::ARG); |
| 68 | 74 | $rules = []; |
@@ -86,6 +92,9 @@ discard block |
||
| 86 | 92 | return $rules; |
| 87 | 93 | } |
| 88 | 94 | |
| 95 | + /** |
|
| 96 | + * @param integer $indexStart |
|
| 97 | + */ |
|
| 89 | 98 | private function processingInstructions($token, $indexStart) { |
| 90 | 99 | if ($token['type'] !== Tokenizer::AT_SIGN) return false; |
| 91 | 100 | $tokens = $this->tss->from(Tokenizer::AT_SIGN, false)->to(Tokenizer::SEMI_COLON, false); |
@@ -98,6 +98,9 @@ |
||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | + /** |
|
| 102 | + * @param integer $n |
|
| 103 | + */ |
|
| 101 | 104 | private function isLiteral($n) { |
| 102 | 105 | //Is it a normal literal character |
| 103 | 106 | return isset($this->str[$n]) && ($this->identifyChar($this->str[$n]) == self::NAME |