@@ -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 | } |
@@ -67,9 +67,9 @@ |
||
67 | 67 | $this->properties[$name] = $property; |
68 | 68 | } |
69 | 69 | |
70 | - public function registerContentPseudo($name, Property\ContentPseudo $pseudo) { |
|
71 | - if (isset($this->properties['content'])) $this->properties['content']->addContentPseudo($name, $pseudo); |
|
72 | - } |
|
70 | + public function registerContentPseudo($name, Property\ContentPseudo $pseudo) { |
|
71 | + if (isset($this->properties['content'])) $this->properties['content']->addContentPseudo($name, $pseudo); |
|
72 | + } |
|
73 | 73 | |
74 | 74 | public function registerPseudo(Pseudo $pseudo) { |
75 | 75 | $this->pseudo[] = $pseudo; |
@@ -68,7 +68,9 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | public function registerContentPseudo($name, Property\ContentPseudo $pseudo) { |
71 | - if (isset($this->properties['content'])) $this->properties['content']->addContentPseudo($name, $pseudo); |
|
71 | + if (isset($this->properties['content'])) { |
|
72 | + $this->properties['content']->addContentPseudo($name, $pseudo); |
|
73 | + } |
|
72 | 74 | } |
73 | 75 | |
74 | 76 | public function registerPseudo(Pseudo $pseudo) { |
@@ -76,12 +78,16 @@ discard block |
||
76 | 78 | } |
77 | 79 | |
78 | 80 | public function loadProperties(Hook\PropertyHook $hook) { |
79 | - foreach ($this->properties as $name => $property) $hook->registerProperty($name, $property); |
|
81 | + foreach ($this->properties as $name => $property) { |
|
82 | + $hook->registerProperty($name, $property); |
|
83 | + } |
|
80 | 84 | } |
81 | 85 | |
82 | 86 | public function createPseudoMatcher($pseudo) { |
83 | 87 | $pseudoMatcher = new Hook\PseudoMatcher($pseudo, $this->valueParser); |
84 | - foreach ($this->pseudo as $pseudoFunction) $pseudoMatcher->registerFunction(clone $pseudoFunction); |
|
88 | + foreach ($this->pseudo as $pseudoFunction) { |
|
89 | + $pseudoMatcher->registerFunction(clone $pseudoFunction); |
|
90 | + } |
|
85 | 91 | return $pseudoMatcher; |
86 | 92 | } |
87 | 93 |