@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Transphporm\Property\ContentPseudo; |
3 | 3 | class BeforeAfter implements \Transphporm\Property\ContentPseudo { |
4 | - private $insertLocation; |
|
5 | - private $content; |
|
4 | + private $insertLocation; |
|
5 | + private $content; |
|
6 | 6 | |
7 | - public function __construct($insertLocation, \Transphporm\Property\Content $content) { |
|
8 | - $this->insertLocation = $insertLocation; |
|
7 | + public function __construct($insertLocation, \Transphporm\Property\Content $content) { |
|
8 | + $this->insertLocation = $insertLocation; |
|
9 | 9 | $this->content = $content; |
10 | 10 | } |
11 | 11 | |
12 | - public function run($value, $pseudoArgs, $element) { |
|
13 | - foreach ($this->content->getNode($value, $element->ownerDocument) as $node) { |
|
12 | + public function run($value, $pseudoArgs, $element) { |
|
13 | + foreach ($this->content->getNode($value, $element->ownerDocument) as $node) { |
|
14 | 14 | if ($this->insertLocation === "before") $element->insertBefore($node, $element->firstChild); |
15 | - else if ($this->insertLocation === "after") $element->appendChild($node); |
|
15 | + else if ($this->insertLocation === "after") $element->appendChild($node); |
|
16 | 16 | } |
17 | - } |
|
17 | + } |
|
18 | 18 | } |
@@ -11,8 +11,11 @@ |
||
11 | 11 | |
12 | 12 | public function run($value, $pseudoArgs, $element) { |
13 | 13 | foreach ($this->content->getNode($value, $element->ownerDocument) as $node) { |
14 | - if ($this->insertLocation === "before") $element->insertBefore($node, $element->firstChild); |
|
15 | - else if ($this->insertLocation === "after") $element->appendChild($node); |
|
14 | + if ($this->insertLocation === "before") { |
|
15 | + $element->insertBefore($node, $element->firstChild); |
|
16 | + } else if ($this->insertLocation === "after") { |
|
17 | + $element->appendChild($node); |
|
18 | + } |
|
16 | 19 | } |
17 | 20 | } |
18 | 21 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Transphporm\Property\ContentPseudo; |
3 | 3 | class Headers implements \Transphporm\Property\ContentPseudo { |
4 | - private $headers; |
|
4 | + private $headers; |
|
5 | 5 | |
6 | - public function __construct(&$headers) { |
|
6 | + public function __construct(&$headers) { |
|
7 | 7 | $this->headers = &$headers; |
8 | 8 | } |
9 | 9 | |
10 | - public function run($value, $pseudoArgs, $element) { |
|
11 | - $this->headers[] = [$pseudoArgs, implode('', $value)]; |
|
12 | - } |
|
10 | + public function run($value, $pseudoArgs, $element) { |
|
11 | + $this->headers[] = [$pseudoArgs, implode('', $value)]; |
|
12 | + } |
|
13 | 13 | } |
@@ -13,15 +13,15 @@ |
||
13 | 13 | $data = $config->getFunctionSet(); |
14 | 14 | $headers = &$config->getHeaders(); |
15 | 15 | |
16 | - $content = new \Transphporm\Property\Content($config->getFormatter()); |
|
16 | + $content = new \Transphporm\Property\Content($config->getFormatter()); |
|
17 | 17 | $config->registerProperty('content', $content); |
18 | 18 | $config->registerProperty('repeat', new \Transphporm\Property\Repeat($data, $config->getElementData(), $config->getLine(), $config->getFilePath())); |
19 | 19 | $config->registerProperty('display', new \Transphporm\Property\Display); |
20 | 20 | $config->registerProperty('bind', new \Transphporm\Property\Bind($config->getElementData())); |
21 | 21 | |
22 | - $content->addContentPseudo("before", new \Transphporm\Property\ContentPseudo\BeforeAfter("before", $content)); |
|
23 | - $content->addContentPseudo("after", new \Transphporm\Property\ContentPseudo\BeforeAfter("after", $content)); |
|
24 | - $content->addContentPseudo("attr", new \Transphporm\Property\ContentPseudo\Attr()); |
|
25 | - $content->addContentPseudo("header", new \Transphporm\Property\ContentPseudo\Headers($headers)); |
|
22 | + $content->addContentPseudo("before", new \Transphporm\Property\ContentPseudo\BeforeAfter("before", $content)); |
|
23 | + $content->addContentPseudo("after", new \Transphporm\Property\ContentPseudo\BeforeAfter("after", $content)); |
|
24 | + $content->addContentPseudo("attr", new \Transphporm\Property\ContentPseudo\Attr()); |
|
25 | + $content->addContentPseudo("header", new \Transphporm\Property\ContentPseudo\Headers($headers)); |
|
26 | 26 | } |
27 | 27 | } |