Passed
Push — master ( 0d0893...6bf0b5 )
by Bruno
05:45 queued 11s
created
util/makeDatatype.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
Formularium/Datatype/Datatype_file.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,9 +104,9 @@
 block discarded – undo
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
                     );
Please login to merge, or discard this patch.