@@ -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 | ); |