@@ -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 | } |
@@ -42,6 +42,9 @@ discard block |
||
42 | 42 | return $this->cache->write($this->file, $rules, $this->import); |
43 | 43 | } |
44 | 44 | |
45 | + /** |
|
46 | + * @param integer $indexStart |
|
47 | + */ |
|
45 | 48 | private function parseTokens($indexStart) { |
46 | 49 | $this->rules = []; |
47 | 50 | foreach (new TokenFilterIterator($this->tss, [Tokenizer::WHITESPACE]) as $token) { |
@@ -66,6 +69,9 @@ discard block |
||
66 | 69 | if (empty($rules) && count($this->tss) > 0) throw new \Exception('No TSS rules parsed'); |
67 | 70 | } |
68 | 71 | |
72 | + /** |
|
73 | + * @param integer $index |
|
74 | + */ |
|
69 | 75 | private function CssToRules($selector, $index, $properties, $line) { |
70 | 76 | $parts = $selector->trim()->splitOnToken(Tokenizer::ARG); |
71 | 77 | $rules = []; |
@@ -89,6 +95,9 @@ discard block |
||
89 | 95 | return $rules; |
90 | 96 | } |
91 | 97 | |
98 | + /** |
|
99 | + * @param integer $indexStart |
|
100 | + */ |
|
92 | 101 | private function processingInstructions($token, $indexStart) { |
93 | 102 | if ($token['type'] !== Tokenizer::AT_SIGN) return false; |
94 | 103 | $tokens = $this->tss->from(Tokenizer::AT_SIGN, false)->to(Tokenizer::SEMI_COLON, false); |
@@ -119,6 +128,10 @@ discard block |
||
119 | 128 | return ($a->depth < $b->depth) ? -1 : 1; |
120 | 129 | } |
121 | 130 | |
131 | + /** |
|
132 | + * @param string $open |
|
133 | + * @param string $close |
|
134 | + */ |
|
122 | 135 | private function stripComments($str, $open, $close) { |
123 | 136 | $pos = 0; |
124 | 137 | while (($pos = strpos($str, $open, $pos)) !== false) { |
@@ -91,6 +91,10 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | //Postprocessing - replace values with null where allowed, or override a value at position |
94 | + |
|
95 | + /** |
|
96 | + * @param boolean $allowNull |
|
97 | + */ |
|
94 | 98 | public function postProcess(ValueData $data, $val, $overrideVal, $allowNull) { |
95 | 99 | foreach ($this->getResult() as $i => $value) { |
96 | 100 | if (is_scalar($value)) { |