@@ -8,7 +8,7 @@ |
||
| 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)) { |
@@ -116,7 +116,9 @@ |
||
| 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 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 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 |
||
| 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 | } |