@@ -74,6 +74,10 @@ |
||
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | //Add a postprocessing hook. This cleans up anything transphporm has added to the markup which needs to be removed |
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @param Template $template |
|
| 80 | + */ |
|
| 77 | 81 | private function doPostProcessing($template) { |
| 78 | 82 | $template->addHook('//*[@transphporm]', new Hook\PostProcess()); |
| 79 | 83 | return $template; |
@@ -30,6 +30,9 @@ discard block |
||
| 30 | 30 | return $rules; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | + /** |
|
| 34 | + * @param integer $indexStart |
|
| 35 | + */ |
|
| 33 | 36 | private function parseTokens($indexStart) { |
| 34 | 37 | $this->rules = []; |
| 35 | 38 | foreach (new TokenFilterIterator($this->tss, [Tokenizer::WHITESPACE]) as $token) { |
@@ -55,6 +58,10 @@ discard block |
||
| 55 | 58 | if (empty($rules) && count($this->tss) > 0) throw new \Exception('No TSS rules parsed'); |
| 56 | 59 | } |
| 57 | 60 | |
| 61 | + /** |
|
| 62 | + * @param Tokens $selector |
|
| 63 | + * @param integer $index |
|
| 64 | + */ |
|
| 58 | 65 | private function CssToRules($selector, $index, $properties, $line) { |
| 59 | 66 | $parts = $selector->trim()->splitOnToken(Tokenizer::ARG); |
| 60 | 67 | $rules = []; |
@@ -78,6 +85,9 @@ discard block |
||
| 78 | 85 | return $rules; |
| 79 | 86 | } |
| 80 | 87 | |
| 88 | + /** |
|
| 89 | + * @param integer $indexStart |
|
| 90 | + */ |
|
| 81 | 91 | private function processingInstructions($token, $indexStart) { |
| 82 | 92 | if ($token['type'] !== Tokenizer::AT_SIGN) return false; |
| 83 | 93 | $tokens = $this->tss->from(Tokenizer::AT_SIGN, false)->to(Tokenizer::SEMI_COLON, false); |
@@ -13,6 +13,10 @@ discard block |
||
| 13 | 13 | private $time; |
| 14 | 14 | private $import = []; |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $tss |
|
| 18 | + * @param string $prefix |
|
| 19 | + */ |
|
| 16 | 20 | public function __construct(Cache $cache, FilePath $filePath, $tss, $prefix, $time) { |
| 17 | 21 | $this->cache = $cache; |
| 18 | 22 | $this->filePath = $filePath; |
@@ -54,6 +58,9 @@ discard block |
||
| 54 | 58 | return $rules; |
| 55 | 59 | } |
| 56 | 60 | |
| 61 | + /** |
|
| 62 | + * @param Template $template |
|
| 63 | + */ |
|
| 57 | 64 | public function processRules($template, \Transphporm\Config $config) { |
| 58 | 65 | $rules = $this->getRules($this->tss, $config->getCssToXpath(), $config->getValueParser()); |
| 59 | 66 | |
@@ -67,6 +74,11 @@ discard block |
||
| 67 | 74 | } |
| 68 | 75 | |
| 69 | 76 | //Load the TSS |
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @param Parser\CssToXpath $cssToXpath |
|
| 80 | + * @param Parser\Value $valueParser |
|
| 81 | + */ |
|
| 70 | 82 | public function getRules($tss, $cssToXpath, $valueParser) { |
| 71 | 83 | if (is_file($tss)) { |
| 72 | 84 | //$rules = $this->cache->load($tss); |
@@ -79,6 +91,10 @@ discard block |
||
| 79 | 91 | } |
| 80 | 92 | |
| 81 | 93 | //Process a TSS rule e.g. `ul li {content: "foo"; format: bar} |
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * @param Config $config |
|
| 97 | + */ |
|
| 82 | 98 | private function executeTssRule($rule, $template, $config) { |
| 83 | 99 | $rule->touch(); |
| 84 | 100 | |