@@ -11,14 +11,14 @@ |
||
11 | 11 | |
12 | 12 | public function viewableCompose(\Formularium\Model $m, array $elements, string $previousCompose): string |
13 | 13 | { |
14 | - return join('', array_map(function ($e) { |
|
14 | + return join('', array_map(function($e) { |
|
15 | 15 | return $e->__toString(); |
16 | 16 | }, $elements)); |
17 | 17 | } |
18 | 18 | |
19 | 19 | public function editableCompose(\Formularium\Model $m, array $elements, string $previousCompose): string |
20 | 20 | { |
21 | - return join('', array_map(function ($e) { |
|
21 | + return join('', array_map(function($e) { |
|
22 | 22 | return $e->__toString(); |
23 | 23 | }, $elements)); |
24 | 24 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | // add extra classes |
29 | 29 | $previous->walk( |
30 | - function ($e) { |
|
30 | + function($e) { |
|
31 | 31 | if ($e instanceof HTMLElement) { |
32 | 32 | if ($e->getTag() === 'input') { |
33 | 33 | $e->setTag('b-datepicker'); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | public function editable($value, Field $field, HTMLElement $previous): HTMLElement |
16 | 16 | { |
17 | - $previous->walk(function (HTMLElement $element) use ($field) { |
|
17 | + $previous->walk(function(HTMLElement $element) use ($field) { |
|
18 | 18 | if ($element->getTag() === 'input') { |
19 | 19 | if ($element->getAttribute('type') === ['checkbox']) { |
20 | 20 | $element->setAttribute('checked', "{this.state.{$field->getName()}}"); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | // add extra classes |
29 | 29 | $previous->walk( |
30 | - function ($e) { |
|
30 | + function($e) { |
|
31 | 31 | if ($e instanceof HTMLElement) { |
32 | 32 | if ($e->getTag() === 'input') { |
33 | 33 | $e->setTag('b-datetimepicker'); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | if (array_key_exists(Renderable::COMMENT, $extensions)) { |
33 | 33 | $base->setAttribute('message', $extensions[Renderable::COMMENT]); |
34 | 34 | } |
35 | - $base->filter(function ($e) { |
|
35 | + $base->filter(function($e) { |
|
36 | 36 | if ($e instanceof HTMLElement) { |
37 | 37 | if ($e->getTag() === 'label') { |
38 | 38 | return false; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $label = $base->get('label.formularium-label'); |
35 | 35 | if (!empty($label)) { |
36 | 36 | // delete |
37 | - $base->filter(function ($e) { |
|
37 | + $base->filter(function($e) { |
|
38 | 38 | return !($e->getTag() === 'label' && $e->getAttribute('class') === ['formularium-label']); |
39 | 39 | }); |
40 | 40 | // fix class |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | $fields = []; |
26 | 26 | $datatypes = array_map( |
27 | - function ($x) { |
|
27 | + function($x) { |
|
28 | 28 | return str_replace('Datatype_', '', str_replace('.php', '', $x)); |
29 | 29 | }, |
30 | 30 | array_diff(scandir(__DIR__ . '/../Formularium/Datatype/'), array('.', '..')) |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // TODO: avoid abstract classes |
33 | 33 | $datatypes = array_filter( |
34 | 34 | $datatypes, |
35 | - function ($t) { |
|
35 | + function($t) { |
|
36 | 36 | return ($t !== 'number' && $t !== 'choice'); |
37 | 37 | } |
38 | 38 | ); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | // add extra classes |
29 | 29 | $previous->walk( |
30 | - function ($e) use ($field) { |
|
30 | + function($e) use ($field) { |
|
31 | 31 | if ($e instanceof HTMLElement) { |
32 | 32 | if ($e->getTag() === 'input') { |
33 | 33 | if (($e->getAttribute('type')[0] ?? '') === 'radio') { |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -$shortopts = "d:p::b::t"; |
|
4 | -$longopts = array( |
|
5 | - "datatype:", // Required value |
|
3 | +$shortopts = "d:p::b::t"; |
|
4 | +$longopts = array( |
|
5 | + "datatype:", // Required value |
|
6 | 6 | "basetype::", |
7 | - "path::", // Optional value |
|
7 | + "path::", // Optional value |
|
8 | 8 | "test" |
9 | 9 | ); |
10 | 10 | $options = getopt($shortopts, $longopts); |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | $datatypeLower = mb_strtolower($options['datatype']); |
18 | 18 | $basetype = $options['basetype'] ?? $datatypeLower; |
19 | 19 | $basetypeClass = (array_key_exists('basetype', $options) ? '\\Formularium\\Datatype\\Datatype_' . $basetype : '\\Formularium\\Datatype'); |
20 | -$path = $options['path'] ?? "Formularium/Datatype/" ; |
|
21 | -$filename = $path . "/Datatype_${datatypeLower}.php"; |
|
20 | +$path = $options['path'] ?? "Formularium/Datatype/"; |
|
21 | +$filename = $path . "/Datatype_${datatypeLower}.php"; |
|
22 | 22 | $generateTest = array_key_exists('test', $options); |
23 | 23 | |
24 | 24 | if (!is_dir($path)) { |