@@ -19,10 +19,10 @@ |
||
| 19 | 19 | protected $mode = self::VUE_MODE_EMBEDDED; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * The tag used as container for fields in viewable() |
|
| 23 | - * |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 22 | + * The tag used as container for fields in viewable() |
|
| 23 | + * |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | 26 | protected $viewableContainerTag = 'div'; |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | public function serialize(): array |
| 126 | 126 | { |
| 127 | 127 | $fields = array_map( |
| 128 | - function ($f) { |
|
| 128 | + function($f) { |
|
| 129 | 129 | return [ |
| 130 | 130 | 'datatype' => $f->getDatatype()->getName(), |
| 131 | 131 | 'validators' => $f->getValidators(), |
@@ -61,12 +61,12 @@ |
||
| 61 | 61 | [], |
| 62 | 62 | HTMLElement::factory( |
| 63 | 63 | 'b-icon', |
| 64 | - [ 'icon' => "upload", 'size' => "is-large" ] |
|
| 64 | + ['icon' => "upload", 'size' => "is-large"] |
|
| 65 | 65 | ) |
| 66 | 66 | ), |
| 67 | 67 | HTMLElement::factory( |
| 68 | 68 | 'p', |
| 69 | - [ 'class' => 'formularium-label'], |
|
| 69 | + ['class' => 'formularium-label'], |
|
| 70 | 70 | $extensions[Renderable::LABEL] ?? '' |
| 71 | 71 | ) |
| 72 | 72 | ] |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | ['class' => "file-icon"], |
| 46 | 46 | HTMLElement::factory( |
| 47 | 47 | 'i', |
| 48 | - [ 'class' => "fas fa-upload" ] |
|
| 48 | + ['class' => "fas fa-upload"] |
|
| 49 | 49 | ) |
| 50 | 50 | ), |
| 51 | 51 | HTMLElement::factory( |
@@ -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-clockpicker'); |
@@ -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)) { |
@@ -104,9 +104,9 @@ |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | if ($field->getValidator(self::DIMENSION_RATIO, false) !== false) { |
| 107 | - $ratio = $width/$height; |
|
| 107 | + $ratio = $width / $height; |
|
| 108 | 108 | $expected = $field->getValidator(self::DIMENSION_RATIO, false); |
| 109 | - if (abs(($ratio-$expected)/$expected) > 0.0001) { |
|
| 109 | + if (abs(($ratio - $expected) / $expected) > 0.0001) { |
|
| 110 | 110 | throw new ValidatorException( |
| 111 | 111 | 'Image width/height ratio should be ' . $field->getValidator(self::DIMENSION_RATIO, false) |
| 112 | 112 | ); |