@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | public function getKey(): string |
39 | 39 | { |
40 | - return $this->key ; |
|
40 | + return $this->key; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function getDefault(): string |
@@ -47,6 +47,6 @@ discard block |
||
47 | 47 | |
48 | 48 | public function getValue(): string |
49 | 49 | { |
50 | - return $this->value ?? $this->default ; |
|
50 | + return $this->value ?? $this->default; |
|
51 | 51 | } |
52 | 52 | } |
@@ -127,7 +127,7 @@ |
||
127 | 127 | */ |
128 | 128 | public function getAttribute(string $name): ?string |
129 | 129 | { |
130 | - return isset($this->attributes[$name]) ? $this->attributes[$name] : null ; |
|
130 | + return isset($this->attributes[$name]) ? $this->attributes[$name] : null; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $alias = $child->getAlias(); |
81 | 81 | } |
82 | 82 | } else { |
83 | - $alias = $this->checkAlias($alias) ? strval($alias) : null ; |
|
83 | + $alias = $this->checkAlias($alias) ? strval($alias) : null; |
|
84 | 84 | $child = new Text(strval($child), $alias); |
85 | 85 | } |
86 | 86 | if (method_exists($child, 'setParent') && $this instanceof IHtmlElement) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | if ($merge && $this->__isset(strval($alias))) { |
92 | 92 | $this->children[strval($alias)]->merge($child); |
93 | 93 | } |
94 | - $this->children[strval($alias)] = $inherit ? $this->inherit($child) : $child ; |
|
94 | + $this->children[strval($alias)] = $inherit ? $this->inherit($child) : $child; |
|
95 | 95 | } else { |
96 | 96 | $this->children[] = $child; |
97 | 97 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | protected function checkAlias($alias): bool |
106 | 106 | { |
107 | - return !(is_null($alias) || ('' === $alias) || (is_object($alias)) || is_resource($alias) ); |
|
107 | + return !(is_null($alias) || ('' === $alias) || (is_object($alias)) || is_resource($alias)); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function lastChild(): ?IHtmlElement |
149 | 149 | { |
150 | 150 | $last = end($this->children); |
151 | - return (false === $last) ? null : $last ; |
|
151 | + return (false === $last) ? null : $last; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function __get($alias): ?IHtmlElement |
187 | 187 | { |
188 | - return $this->__isset($alias) ? $this->children[$alias] : null ; |
|
188 | + return $this->__isset($alias) ? $this->children[$alias] : null; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | use TCss, TStyles; |
20 | 20 | |
21 | 21 | /** @var string[] */ |
22 | - protected static array $emptyElements = ['img','hr','br','input','meta','area','embed','keygen','link','param','frame']; |
|
22 | + protected static array $emptyElements = ['img', 'hr', 'br', 'input', 'meta', 'area', 'embed', 'keygen', 'link', 'param', 'frame']; |
|
23 | 23 | |
24 | 24 | /** @var string element's name */ |
25 | 25 | private string $name = ''; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function __construct(string $name, array $attributes = []) |
43 | 43 | { |
44 | - $name = strval(str_ireplace(['<','>'],'', $name)); |
|
44 | + $name = strval(str_ireplace(['<', '>'], '', $name)); |
|
45 | 45 | $parts = explode(' ', $name, 2); |
46 | 46 | $name = $parts[0]; |
47 | 47 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | protected string $template = ''; |
14 | 14 | protected string $defaultTemplate = ''; |
15 | - protected static ?Template\Item $item = null; |
|
15 | + protected static ? Template\Item $item = null; |
|
16 | 16 | /** @var Template\Item[] */ |
17 | 17 | protected array $items = []; |
18 | 18 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | protected function getItem(string $key): ?Template\Item |
59 | 59 | { |
60 | - return isset($this->items[$key]) ? $this->items[$key] : null ; |
|
60 | + return isset($this->items[$key]) ? $this->items[$key] : null; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | protected function updateItem(string $key, ?string $value): self |