@@ -7,5 +7,5 @@ |
||
7 | 7 | */ |
8 | 8 | class Script extends AbstractFilter |
9 | 9 | { |
10 | - protected $tag = 'script'; |
|
10 | + protected $tag = 'script'; |
|
11 | 11 | } |
@@ -7,10 +7,10 @@ |
||
7 | 7 | */ |
8 | 8 | class Pre extends AbstractFilter |
9 | 9 | { |
10 | - protected $tag = 'pre'; |
|
10 | + protected $tag = 'pre'; |
|
11 | 11 | |
12 | - public function parse($contents) |
|
13 | - { |
|
14 | - return htmlspecialchars(trim($contents)); |
|
15 | - } |
|
12 | + public function parse($contents) |
|
13 | + { |
|
14 | + return htmlspecialchars(trim($contents)); |
|
15 | + } |
|
16 | 16 | } |
@@ -7,8 +7,8 @@ |
||
7 | 7 | |
8 | 8 | class Cdata extends AbstractFilter |
9 | 9 | { |
10 | - public function __invoke(Filter $node, Compiler $compiler) |
|
11 | - { |
|
12 | - return "<![CDATA[\n" . $this->getNodeString($node, $compiler) . "\n]]>"; |
|
13 | - } |
|
10 | + public function __invoke(Filter $node, Compiler $compiler) |
|
11 | + { |
|
12 | + return "<![CDATA[\n" . $this->getNodeString($node, $compiler) . "\n]]>"; |
|
13 | + } |
|
14 | 14 | } |
@@ -10,26 +10,26 @@ |
||
10 | 10 | */ |
11 | 11 | class Php implements FilterInterface |
12 | 12 | { |
13 | - /** |
|
14 | - * @param Filter $node |
|
15 | - * @param Compiler $compiler |
|
16 | - * |
|
17 | - * @return string |
|
18 | - */ |
|
19 | - public function __invoke(Filter $node, Compiler $compiler) |
|
20 | - { |
|
21 | - $data = ''; |
|
13 | + /** |
|
14 | + * @param Filter $node |
|
15 | + * @param Compiler $compiler |
|
16 | + * |
|
17 | + * @return string |
|
18 | + */ |
|
19 | + public function __invoke(Filter $node, Compiler $compiler) |
|
20 | + { |
|
21 | + $data = ''; |
|
22 | 22 | |
23 | - foreach ($node->block->nodes as $n) { |
|
24 | - if (isset($n->value)) { |
|
25 | - $data .= preg_match('/^[[:space:]]*\|(?!\|)(.*)/', $n->value, $m) |
|
26 | - ? ' ?> ' . $m[1] . '<?php ' |
|
27 | - : $n->value . "\n"; |
|
28 | - continue; |
|
29 | - } |
|
30 | - $data .= ' ?> ' . $compiler->subCompiler()->compile($n) . '<?php '; |
|
31 | - } |
|
23 | + foreach ($node->block->nodes as $n) { |
|
24 | + if (isset($n->value)) { |
|
25 | + $data .= preg_match('/^[[:space:]]*\|(?!\|)(.*)/', $n->value, $m) |
|
26 | + ? ' ?> ' . $m[1] . '<?php ' |
|
27 | + : $n->value . "\n"; |
|
28 | + continue; |
|
29 | + } |
|
30 | + $data .= ' ?> ' . $compiler->subCompiler()->compile($n) . '<?php '; |
|
31 | + } |
|
32 | 32 | |
33 | - return $data ? '<?php ' . $data . ' ?> ' : $data; |
|
34 | - } |
|
33 | + return $data ? '<?php ' . $data . ' ?> ' : $data; |
|
34 | + } |
|
35 | 35 | } |
@@ -9,71 +9,71 @@ |
||
9 | 9 | */ |
10 | 10 | class Template |
11 | 11 | { |
12 | - /** |
|
13 | - * @var int |
|
14 | - */ |
|
15 | - private $position = 0; |
|
12 | + /** |
|
13 | + * @var int |
|
14 | + */ |
|
15 | + private $position = 0; |
|
16 | 16 | |
17 | - /** |
|
18 | - * @var string |
|
19 | - */ |
|
20 | - private $data = ''; |
|
17 | + /** |
|
18 | + * @var string |
|
19 | + */ |
|
20 | + private $data = ''; |
|
21 | 21 | |
22 | - /** |
|
23 | - * @param $path |
|
24 | - * |
|
25 | - * @return bool |
|
26 | - */ |
|
27 | - public function stream_open($path) |
|
28 | - { |
|
29 | - $this->data = substr(strstr($path, ';'), 1); |
|
22 | + /** |
|
23 | + * @param $path |
|
24 | + * |
|
25 | + * @return bool |
|
26 | + */ |
|
27 | + public function stream_open($path) |
|
28 | + { |
|
29 | + $this->data = substr(strstr($path, ';'), 1); |
|
30 | 30 | |
31 | - return true; |
|
32 | - } |
|
31 | + return true; |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * @return null |
|
36 | - */ |
|
37 | - public function stream_stat() |
|
38 | - { |
|
39 | - } |
|
34 | + /** |
|
35 | + * @return null |
|
36 | + */ |
|
37 | + public function stream_stat() |
|
38 | + { |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param $count |
|
43 | - * |
|
44 | - * @return string |
|
45 | - */ |
|
46 | - public function stream_read($count) |
|
47 | - { |
|
48 | - $ret = substr($this->data, $this->position, $count); |
|
49 | - $this->position += strlen($ret); |
|
41 | + /** |
|
42 | + * @param $count |
|
43 | + * |
|
44 | + * @return string |
|
45 | + */ |
|
46 | + public function stream_read($count) |
|
47 | + { |
|
48 | + $ret = substr($this->data, $this->position, $count); |
|
49 | + $this->position += strlen($ret); |
|
50 | 50 | |
51 | - return $ret; |
|
52 | - } |
|
51 | + return $ret; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return int |
|
56 | - */ |
|
57 | - public function stream_tell() |
|
58 | - { |
|
59 | - return $this->position; |
|
60 | - } |
|
54 | + /** |
|
55 | + * @return int |
|
56 | + */ |
|
57 | + public function stream_tell() |
|
58 | + { |
|
59 | + return $this->position; |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @return bool |
|
64 | - */ |
|
65 | - public function stream_eof() |
|
66 | - { |
|
67 | - return $this->position >= strlen($this->data); |
|
68 | - } |
|
62 | + /** |
|
63 | + * @return bool |
|
64 | + */ |
|
65 | + public function stream_eof() |
|
66 | + { |
|
67 | + return $this->position >= strlen($this->data); |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * Dummy URL stat method to prevent PHP "undefined method" errors. |
|
72 | - * |
|
73 | - * @return array |
|
74 | - */ |
|
75 | - public function url_stat($path, $flags) |
|
76 | - { |
|
77 | - return array(0, 0, 0, 0, 0, 0, 0, strlen($this->data), 0, 0, 0, 0); |
|
78 | - } |
|
70 | + /** |
|
71 | + * Dummy URL stat method to prevent PHP "undefined method" errors. |
|
72 | + * |
|
73 | + * @return array |
|
74 | + */ |
|
75 | + public function url_stat($path, $flags) |
|
76 | + { |
|
77 | + return array(0, 0, 0, 0, 0, 0, 0, strlen($this->data), 0, 0, 0, 0); |
|
78 | + } |
|
79 | 79 | } |
@@ -4,12 +4,12 @@ |
||
4 | 4 | |
5 | 5 | class Comment extends Node |
6 | 6 | { |
7 | - public $value; |
|
8 | - public $buffer; |
|
7 | + public $value; |
|
8 | + public $buffer; |
|
9 | 9 | |
10 | - public function __construct($value, $buffer) |
|
11 | - { |
|
12 | - $this->value = $value; |
|
13 | - $this->buffer = $buffer; |
|
14 | - } |
|
10 | + public function __construct($value, $buffer) |
|
11 | + { |
|
12 | + $this->value = $value; |
|
13 | + $this->buffer = $buffer; |
|
14 | + } |
|
15 | 15 | } |
@@ -5,12 +5,12 @@ |
||
5 | 5 | // cant use the keyword case as class name |
6 | 6 | class CaseNode extends Node |
7 | 7 | { |
8 | - public $expr; |
|
9 | - public $block; |
|
8 | + public $expr; |
|
9 | + public $block; |
|
10 | 10 | |
11 | - public function __construct($expr, $block = null) |
|
12 | - { |
|
13 | - $this->expr = $expr; |
|
14 | - $this->block = $block; |
|
15 | - } |
|
11 | + public function __construct($expr, $block = null) |
|
12 | + { |
|
13 | + $this->expr = $expr; |
|
14 | + $this->block = $block; |
|
15 | + } |
|
16 | 16 | } |
@@ -4,72 +4,72 @@ |
||
4 | 4 | |
5 | 5 | class Block extends Node |
6 | 6 | { |
7 | - public $isBlock = true; |
|
8 | - public $nodes = array(); |
|
7 | + public $isBlock = true; |
|
8 | + public $nodes = array(); |
|
9 | 9 | |
10 | - public function __construct($node = null) |
|
11 | - { |
|
12 | - if (null !== $node) { |
|
13 | - $this->push($node); |
|
14 | - } |
|
15 | - } |
|
10 | + public function __construct($node = null) |
|
11 | + { |
|
12 | + if (null !== $node) { |
|
13 | + $this->push($node); |
|
14 | + } |
|
15 | + } |
|
16 | 16 | |
17 | - public function replace($other) |
|
18 | - { |
|
19 | - $other->nodes = $this->nodes; |
|
20 | - } |
|
17 | + public function replace($other) |
|
18 | + { |
|
19 | + $other->nodes = $this->nodes; |
|
20 | + } |
|
21 | 21 | |
22 | - public function push($node) |
|
23 | - { |
|
24 | - return array_push($this->nodes, $node); |
|
25 | - } |
|
22 | + public function push($node) |
|
23 | + { |
|
24 | + return array_push($this->nodes, $node); |
|
25 | + } |
|
26 | 26 | |
27 | - public function isEmpty() |
|
28 | - { |
|
29 | - return 0 === count($this->nodes); |
|
30 | - } |
|
27 | + public function isEmpty() |
|
28 | + { |
|
29 | + return 0 === count($this->nodes); |
|
30 | + } |
|
31 | 31 | |
32 | - public function unshift($node) |
|
33 | - { |
|
34 | - return array_unshift($this->nodes, $node); |
|
35 | - } |
|
32 | + public function unshift($node) |
|
33 | + { |
|
34 | + return array_unshift($this->nodes, $node); |
|
35 | + } |
|
36 | 36 | |
37 | - public function getYield() |
|
38 | - { |
|
39 | - foreach ($this->nodes as $node) { |
|
40 | - if (isset($node->yield)) { |
|
41 | - return $node; |
|
42 | - } elseif (isset($node->block) && $yield = $node->block->getYield()) { |
|
43 | - return $yield; |
|
44 | - } |
|
45 | - } |
|
37 | + public function getYield() |
|
38 | + { |
|
39 | + foreach ($this->nodes as $node) { |
|
40 | + if (isset($node->yield)) { |
|
41 | + return $node; |
|
42 | + } elseif (isset($node->block) && $yield = $node->block->getYield()) { |
|
43 | + return $yield; |
|
44 | + } |
|
45 | + } |
|
46 | 46 | |
47 | - return false; |
|
48 | - } |
|
47 | + return false; |
|
48 | + } |
|
49 | 49 | |
50 | - public function includeBlock() |
|
51 | - { |
|
52 | - $ret = $this; |
|
53 | - foreach ($this->nodes as $node) { |
|
54 | - if (isset($node->yield)) { |
|
55 | - return $node; |
|
56 | - } |
|
50 | + public function includeBlock() |
|
51 | + { |
|
52 | + $ret = $this; |
|
53 | + foreach ($this->nodes as $node) { |
|
54 | + if (isset($node->yield)) { |
|
55 | + return $node; |
|
56 | + } |
|
57 | 57 | |
58 | - if (isset($node->block) && $yield = $node->block->getYield()) { |
|
59 | - return $yield; |
|
60 | - } |
|
58 | + if (isset($node->block) && $yield = $node->block->getYield()) { |
|
59 | + return $yield; |
|
60 | + } |
|
61 | 61 | |
62 | - if (isset($node->textOnly)) { |
|
63 | - continue; |
|
64 | - } |
|
62 | + if (isset($node->textOnly)) { |
|
63 | + continue; |
|
64 | + } |
|
65 | 65 | |
66 | - if (method_exists($node, 'includeBlock')) { |
|
67 | - $ret = $node->includeBlock(); |
|
68 | - } elseif (isset($node->block) && !$node->block->isEmpty()) { |
|
69 | - $ret = $node->block->includeBlock(); |
|
70 | - } |
|
71 | - } |
|
66 | + if (method_exists($node, 'includeBlock')) { |
|
67 | + $ret = $node->includeBlock(); |
|
68 | + } elseif (isset($node->block) && !$node->block->isEmpty()) { |
|
69 | + $ret = $node->block->includeBlock(); |
|
70 | + } |
|
71 | + } |
|
72 | 72 | |
73 | - return $ret; |
|
74 | - } |
|
73 | + return $ret; |
|
74 | + } |
|
75 | 75 | } |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | class Text extends Node |
6 | 6 | { |
7 | - public $isText = true; |
|
8 | - public $value = ''; |
|
7 | + public $isText = true; |
|
8 | + public $value = ''; |
|
9 | 9 | |
10 | - public function __construct($line) |
|
11 | - { |
|
12 | - if (is_string($line)) { |
|
13 | - $this->value = $line; |
|
14 | - } |
|
15 | - } |
|
10 | + public function __construct($line) |
|
11 | + { |
|
12 | + if (is_string($line)) { |
|
13 | + $this->value = $line; |
|
14 | + } |
|
15 | + } |
|
16 | 16 | } |