@@ -34,6 +34,10 @@ discard block |
||
34 | 34 | return (isset($rules['content-mode'])) ? $rules['content-mode'] : 'append'; |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param \DOMElement $element |
|
39 | + * @param \Transphporm\Hook\PseudoMatcher $pseudoMatcher |
|
40 | + */ |
|
37 | 41 | private function processPseudo($value, $element, $pseudoMatcher) { |
38 | 42 | $pseudoContent = ['attr', 'header', 'before', 'after']; |
39 | 43 | foreach ($pseudoContent as $pseudo) { |
@@ -91,6 +95,9 @@ discard block |
||
91 | 95 | foreach ($remove as $r) $r->parentNode->removeChild($r); |
92 | 96 | } |
93 | 97 | |
98 | + /** |
|
99 | + * @param \DOMElement $element |
|
100 | + */ |
|
94 | 101 | private function replaceContent($element, $content) { |
95 | 102 | //If this rule was cached, the elements that were added last time need to be removed prior to running the rule again. |
96 | 103 | $this->removeAdded($element); |
@@ -100,12 +107,18 @@ discard block |
||
100 | 107 | $element->setAttribute('transphporm', 'remove'); |
101 | 108 | } |
102 | 109 | |
110 | + /** |
|
111 | + * @param \DOMElement $element |
|
112 | + */ |
|
103 | 113 | private function appendContent($element, $content) { |
104 | 114 | foreach ($this->getNode($content, $element->ownerDocument) as $node) { |
105 | 115 | $element->appendChild($node); |
106 | 116 | } |
107 | 117 | } |
108 | 118 | |
119 | + /** |
|
120 | + * @param \DOMElement $element |
|
121 | + */ |
|
109 | 122 | private function removeAllChildren($element) { |
110 | 123 | while ($element->hasChildNodes()) $element->removeChild($element->firstChild); |
111 | 124 | } |
@@ -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); |