@@ -34,6 +34,9 @@ |
||
34 | 34 | return false; |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param \Transphporm\Hook\PseudoMatcher $pseudoMatcher |
|
39 | + */ |
|
37 | 40 | private function createHook($newRules, $pseudoMatcher, $properties) { |
38 | 41 | $hook = new \Transphporm\Hook\PropertyHook($newRules, $pseudoMatcher, new \Transphporm\Parser\Value($this->data)); |
39 | 42 | foreach ($properties as $name => $property) $hook->registerProperty($name, $property); |
@@ -13,6 +13,9 @@ discard block |
||
13 | 13 | private $formatter; |
14 | 14 | private $baseDir; |
15 | 15 | |
16 | + /** |
|
17 | + * @param string $baseDir |
|
18 | + */ |
|
16 | 19 | public function __construct(Functionset $functionSet, Hook\ElementData $elementData, Hook\Formatter $formatter, &$headers, &$baseDir) { |
17 | 20 | $this->formatter = $formatter; |
18 | 21 | $this->headers = &$headers; |
@@ -41,10 +44,16 @@ discard block |
||
41 | 44 | return $this->functionSet; |
42 | 45 | } |
43 | 46 | |
47 | + /** |
|
48 | + * @return Hook\ElementData |
|
49 | + */ |
|
44 | 50 | public function getElementData() { |
45 | 51 | return $this->elementData; |
46 | 52 | } |
47 | 53 | |
54 | + /** |
|
55 | + * @param string $name |
|
56 | + */ |
|
48 | 57 | public function registerProperty($name, Property $property) { |
49 | 58 | $this->properties[$name] = $property; |
50 | 59 | } |
@@ -11,6 +11,9 @@ discard block |
||
11 | 11 | private $data; |
12 | 12 | private $baseDir; |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $baseDir |
|
16 | + */ |
|
14 | 17 | public function __construct(Hook\ElementData $elementData, &$baseDir) { |
15 | 18 | $this->baseDir = &$baseDir; |
16 | 19 | $this->elementData = $elementData; |
@@ -23,6 +26,9 @@ discard block |
||
23 | 26 | else return \Transphporm\Parser\Value::IS_NOT_FUNCTION; |
24 | 27 | } |
25 | 28 | |
29 | + /** |
|
30 | + * @param string $name |
|
31 | + */ |
|
26 | 32 | public function addFunction($name, \Transphporm\TSSFunction $function) { |
27 | 33 | $this->functions[$name] = $function; |
28 | 34 | } |
@@ -11,6 +11,9 @@ discard block |
||
11 | 11 | private $formatter; |
12 | 12 | |
13 | 13 | |
14 | + /** |
|
15 | + * @param \Transphporm\FunctionSet $data |
|
16 | + */ |
|
14 | 17 | public function __construct($data, &$headers, \Transphporm\Hook\Formatter $formatter) { |
15 | 18 | $this->data = $data; |
16 | 19 | $this->headers = &$headers; |
@@ -30,6 +33,9 @@ discard block |
||
30 | 33 | } |
31 | 34 | } |
32 | 35 | |
36 | + /** |
|
37 | + * @param \DOMElement $element |
|
38 | + */ |
|
33 | 39 | private function shouldRun($element) { |
34 | 40 | if ($element->getAttribute('transphporm') === 'remove') return false; |
35 | 41 | do { |
@@ -43,6 +49,10 @@ discard block |
||
43 | 49 | return (isset($rules['content-mode'])) ? $rules['content-mode'] : 'append'; |
44 | 50 | } |
45 | 51 | |
52 | + /** |
|
53 | + * @param \DOMElement $element |
|
54 | + * @param \Transphporm\Hook\PseudoMatcher $pseudoMatcher |
|
55 | + */ |
|
46 | 56 | private function processPseudo($value, $element, $pseudoMatcher) { |
47 | 57 | $pseudoContent = ['attr', 'header', 'before', 'after']; |
48 | 58 | foreach ($pseudoContent as $pseudo) { |
@@ -93,6 +103,9 @@ discard block |
||
93 | 103 | } |
94 | 104 | } |
95 | 105 | |
106 | + /** |
|
107 | + * @param \DOMElement $element |
|
108 | + */ |
|
96 | 109 | private function replaceContent($element, $content) { |
97 | 110 | //If this rule was cached, the elements that were added last time need to be removed prior to running the rule again. |
98 | 111 | foreach ($this->getNode($content, $element->ownerDocument) as $node) { |
@@ -101,12 +114,18 @@ discard block |
||
101 | 114 | $element->setAttribute('transphporm', 'remove'); |
102 | 115 | } |
103 | 116 | |
117 | + /** |
|
118 | + * @param \DOMElement $element |
|
119 | + */ |
|
104 | 120 | private function appendContent($element, $content) { |
105 | 121 | foreach ($this->getNode($content, $element->ownerDocument) as $node) { |
106 | 122 | $element->appendChild($node); |
107 | 123 | } |
108 | 124 | } |
109 | 125 | |
126 | + /** |
|
127 | + * @param \DOMElement $element |
|
128 | + */ |
|
110 | 129 | private function removeAllChildren($element) { |
111 | 130 | while ($element->hasChildNodes()) $element->removeChild($element->firstChild); |
112 | 131 | } |
@@ -17,6 +17,9 @@ discard block |
||
17 | 17 | $this->functionSet = $functionSet; |
18 | 18 | } |
19 | 19 | |
20 | + /** |
|
21 | + * @param \DOMElement $element |
|
22 | + */ |
|
20 | 23 | private function traverse($name, $data, $element) { |
21 | 24 | $name = str_replace(['[', ']'], ['.', ''], $name); |
22 | 25 | $parts = explode('.', $name); |
@@ -37,6 +40,9 @@ discard block |
||
37 | 40 | return $obj; |
38 | 41 | } |
39 | 42 | |
43 | + /** |
|
44 | + * @param \Transphporm\Parser\Value $valueParser |
|
45 | + */ |
|
40 | 46 | private function traverseObj($part, $obj, $valueParser, $element) { |
41 | 47 | if (strpos($part, '(') !== false) { |
42 | 48 | $subObjParser = new \Transphporm\Parser\Value($obj, $valueParser, false); |