@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | foreach ($list as $value => $label) { |
| 108 | 108 | $option_attributes = ['value' => $value]; |
| 109 | 109 | if ($selected == $value) { |
| 110 | - $option_attributes['selected'] = 'selected'; |
|
| 110 | + $option_attributes['selected'] = 'selected'; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | $options .= new Element('option', "$label", $option_attributes); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public static function legend(string $label, array $attributes = []): string |
| 127 | 127 | { |
| 128 | - return '' . (new Element('legend', $label, $attributes)); |
|
| 128 | + return ''.(new Element('legend', $label, $attributes)); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | public static function button(string $label, array $attributes = []): string |
| 148 | 148 | { |
| 149 | - return '' . (new Element('button', $label, $attributes)); |
|
| 149 | + return ''.(new Element('button', $label, $attributes)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -201,6 +201,6 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| 204 | - return $label . (new Element($tag, $content, $attributes)); |
|
| 204 | + return $label.(new Element($tag, $content, $attributes)); |
|
| 205 | 205 | } |
| 206 | 206 | } |
@@ -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 | - * ? smoother write |
|
| 16 | - * Marker::img('path/to/img.jpg', 'An alternative text', ['width' => 34, 'height' => 34]) |
|
| 17 | - * than |
|
| 18 | - * Element::img(null, ['src' => 'path/to/img.jpg', 'alt' => 'An alternative text', 'width' => 34, 'height' => 34]) |
|
| 19 | - */ |
|
| 15 | + * ? smoother write |
|
| 16 | + * Marker::img('path/to/img.jpg', 'An alternative text', ['width' => 34, 'height' => 34]) |
|
| 17 | + * than |
|
| 18 | + * Element::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; |
@@ -53,7 +53,6 @@ |
||
| 53 | 53 | * ex: Element::div('foo', ['class' => 'bar']) |
| 54 | 54 | * ex: Element::img(null, ['src' => 'path/to/jpeg.png', alt='hyper descriptive', 'width' => 100, 'height' => 100]) |
| 55 | 55 | * ex: Element::a('click here', ['href' => 'url/to/destination']) |
| 56 | - |
|
| 57 | 56 | * @param string $tag The HTML tag for the element. |
| 58 | 57 | * @param mixed $content The content of the element. |
| 59 | 58 | * @param array $attributes The attributes of the element. |