@@ -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)) { |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php declare(strict_types=1); |
| 2 | 2 | |
| 3 | -$shortopts = "v:p::t"; |
|
| 4 | -$longopts = array( |
|
| 5 | - "validator:", // Required value |
|
| 6 | - "path::", // Optional value |
|
| 3 | +$shortopts = "v:p::t"; |
|
| 4 | +$longopts = array( |
|
| 5 | + "validator:", // Required value |
|
| 6 | + "path::", // Optional value |
|
| 7 | 7 | "test" |
| 8 | 8 | ); |
| 9 | 9 | $options = getopt($shortopts, $longopts); |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | $validator = $options['validator']; |
| 16 | 16 | $validatorLower = mb_strtolower($options['validator']); |
| 17 | 17 | $basetype = $options['basetype'] ?? $validatorLower; |
| 18 | -$path = $options['path'] ?? "Formularium/Validator/" ; |
|
| 19 | -$filename = $path . "/${validator}.php"; |
|
| 18 | +$path = $options['path'] ?? "Formularium/Validator/"; |
|
| 19 | +$filename = $path . "/${validator}.php"; |
|
| 20 | 20 | $generateTest = array_key_exists('test', $options); |
| 21 | 21 | |
| 22 | 22 | if (!is_dir($path)) { |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | public const RELATIONSHIP = "RELATIONSHIP"; |
| 12 | 12 | public const RELATIONSHIP_ONE_TO_ONE = "RELATIONSHIP_ONE_TO_ONE"; |
| 13 | 13 | public const RELATIONSHIP_ONE_TO_MANY = "RELATIONSHIP_ONE_TO_MANY"; |
| 14 | - public const RELATIONSHIP_MANY_TO_MANY = "RELATIONSHIP_MANY_TO_MANY"; |
|
| 14 | + public const RELATIONSHIP_MANY_TO_MANY = "RELATIONSHIP_MANY_TO_MANY"; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @var string |
@@ -203,9 +203,9 @@ |
||
| 203 | 203 | 'Zero width or height' |
| 204 | 204 | ); |
| 205 | 205 | } |
| 206 | - $ratio = $width/$height; |
|
| 206 | + $ratio = $width / $height; |
|
| 207 | 207 | $expected = $field->getValidator(self::DIMENSION_RATIO, false); |
| 208 | - if (abs(($ratio-$expected)/$expected) > 0.0001) { |
|
| 208 | + if (abs(($ratio - $expected) / $expected) > 0.0001) { |
|
| 209 | 209 | throw new ValidatorException( |
| 210 | 210 | 'Image width/height ratio should be ' . $field->getValidator(self::DIMENSION_RATIO, false) |
| 211 | 211 | ); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function editable($value, Field $field, HTMLElement $previous): HTMLElement |
| 16 | 16 | { |
| 17 | 17 | $previous->filter( |
| 18 | - function ($e) { |
|
| 18 | + function($e) { |
|
| 19 | 19 | if ($e->getTag() === 'canvas') { |
| 20 | 20 | return false; |
| 21 | 21 | } |