Completed
Push — master ( b10a48...29cde4 )
by Ori
05:27
created
src/Fields/FieldsInferrer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
     /**
9 9
      * @param null|array $rows optional initial rows to infer by, each row is an array of field name => field value
10 10
      */
11
-    public function __construct($rows=null, $lenient=false)
11
+    public function __construct($rows = null, $lenient = false)
12 12
     {
13 13
         $this->lenient = $lenient;
14 14
         if (!empty($rows)) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,9 @@
 block discarded – undo
116 116
             try {
117 117
                 $rowNum = 0;
118 118
                 foreach ($this->inputRows as $inputRow) {
119
-                    if (!array_key_exists($rowNum, $this->castRows)) $this->castRows[$rowNum] = [];
119
+                    if (!array_key_exists($rowNum, $this->castRows)) {
120
+                        $this->castRows[$rowNum] = [];
121
+                    }
120 122
                     $this->castRows[$rowNum][$fieldName] = $inferredField->castValue($inputRow[$fieldName]);
121 123
                     $rowNum++;
122 124
                 }
Please login to merge, or discard this patch.
src/Fields/StringField.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
         return isset($this->descriptor()->format) ? $this->descriptor()->format : null;
11 11
     }
12 12
 
13
-    public function inferProperties($val, $lenient=false)
13
+    public function inferProperties($val, $lenient = false)
14 14
     {
15 15
         parent::inferProperties($val, $lenient);
16 16
         if (!$lenient) {
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
         return "string";
40 40
     }
41 41
 
42
-    public function getInferIdentifier($lenient=false)
42
+    public function getInferIdentifier($lenient = false)
43 43
     {
44 44
         $inferId = parent::getInferIdentifier();
45 45
         $format = $this->format();
46 46
         if (!$lenient && !empty($format)) {
47
-            $inferId .= ":".$this->format();
47
+            $inferId .= ":" . $this->format();
48 48
         };
49 49
         return $inferId;
50 50
     }
Please login to merge, or discard this patch.