@@ -315,7 +315,7 @@ |
||
315 | 315 | return |
316 | 316 | Marker::div( |
317 | 317 | Marker::label( |
318 | - Form::input($name, $value, $attributes) . Marker::span($label), |
|
318 | + Form::input($name, $value, $attributes).Marker::span($label), |
|
319 | 319 | ['for' => $attributes['id']] |
320 | 320 | ), |
321 | 321 | ['class' => 'checkbutton'] |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** |
4 | - * HTML generator |
|
5 | - * Marker, hommage to Christian François Bouche-Villeneuve aka Chris Marker |
|
6 | - */ |
|
4 | + * HTML generator |
|
5 | + * Marker, hommage to Christian François Bouche-Villeneuve aka Chris Marker |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | declare(strict_types=1); |
9 | 9 | |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | class Marker extends Element |
13 | 13 | { |
14 | 14 | /** |
15 | - * ? makes more sense to write |
|
16 | - * Marker::img('path/to/img.jpg', 'An alternative text', ['width' => 34, 'height' => 34]) |
|
17 | - * than |
|
18 | - * Marker::img(null, ['src' => 'path/to/img.jpg', 'alt' => 'An alternative text', 'width' => 34, 'height' => 34]) |
|
19 | - */ |
|
15 | + * ? makes more sense to write |
|
16 | + * Marker::img('path/to/img.jpg', 'An alternative text', ['width' => 34, 'height' => 34]) |
|
17 | + * than |
|
18 | + * Marker::img(null, ['src' => 'path/to/img.jpg', 'alt' => 'An alternative text', 'width' => 34, 'height' => 34]) |
|
19 | + */ |
|
20 | 20 | public static function img(string $src, string $alt, array $attributes = []): Element |
21 | 21 | { |
22 | 22 | $attributes['src'] ??= $src; |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | - * ? makes more sense to write |
|
31 | - * Marker::a('controller/task/id', 'Click here', ['class' => 'nav']) |
|
32 | - * than |
|
33 | - * Marker::a('Click here', ['href' => controller/task/id', 'class' => 'nav']) |
|
34 | - */ |
|
30 | + * ? makes more sense to write |
|
31 | + * Marker::a('controller/task/id', 'Click here', ['class' => 'nav']) |
|
32 | + * than |
|
33 | + * Marker::a('Click here', ['href' => controller/task/id', 'class' => 'nav']) |
|
34 | + */ |
|
35 | 35 | public static function a(string $href, string $label, array $attributes = []): Element |
36 | 36 | { |
37 | 37 | $attributes['href'] ??= $href; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | foreach ($list as $value => $label) { |
109 | 109 | $option_attributes = ['value' => $value]; |
110 | 110 | if ($selected == $value) { |
111 | - $option_attributes['selected'] = 'selected'; |
|
111 | + $option_attributes['selected'] = 'selected'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | $options .= new Element('option', "$label", $option_attributes); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public static function legend(string $label, array $attributes = []): string |
128 | 128 | { |
129 | - return '' . (new Element('legend', $label, $attributes)); |
|
129 | + return ''.(new Element('legend', $label, $attributes)); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | public static function button(string $label, array $attributes = []): string |
149 | 149 | { |
150 | - return '' . (new Element('button', $label, $attributes)); |
|
150 | + return ''.(new Element('button', $label, $attributes)); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -201,6 +201,6 @@ discard block |
||
201 | 201 | unset($attributes['label']); |
202 | 202 | } |
203 | 203 | |
204 | - return $label . (new Element($tag, $content, $attributes)); |
|
204 | + return $label.(new Element($tag, $content, $attributes)); |
|
205 | 205 | } |
206 | 206 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | foreach ($this->tags as $tag) { |
51 | 51 | $e = new Element($tag); |
52 | 52 | if ($e->isVoid()) { |
53 | - $this->assertEquals('<' . $tag . '/>', $e->__toString()); |
|
53 | + $this->assertEquals('<'.$tag.'/>', $e->__toString()); |
|
54 | 54 | } else { |
55 | 55 | $this->assertEquals(sprintf('<%s></%s>', $tag, $tag), $e->__toString()); |
56 | 56 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $e = new Element($tag, $message); |
71 | 71 | |
72 | 72 | if ($e->isVoid()) { |
73 | - $this->assertEquals('<' . $tag . '/>', $e->__toString()); |
|
73 | + $this->assertEquals('<'.$tag.'/>', $e->__toString()); |
|
74 | 74 | } else { |
75 | 75 | $this->assertEquals(sprintf('<%s>%s</%s>', $tag, $expected, $tag), $e->__toString()); |
76 | 76 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $this->assertForAllHTMLTags($message, $attributes, $attributes_expected_string); |
120 | 120 | |
121 | 121 | |
122 | - $attributes = ['class' => 'test_class', 'style="color:red;"','id' => 'test_id']; |
|
122 | + $attributes = ['class' => 'test_class', 'style="color:red;"', 'id' => 'test_id']; |
|
123 | 123 | $attributes_expected_string = ' class="test_class" style="color:red;" id="test_id"'; |
124 | 124 | |
125 | 125 | // testing attributes string generator |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $this->content = $content; |
79 | 79 | |
80 | 80 | foreach ($attributes as $name => $value) { |
81 | - if(is_int($name)) { |
|
81 | + if (is_int($name)) { |
|
82 | 82 | $name = $value; |
83 | 83 | } |
84 | 84 |