| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function castRow($row) |
||
| 29 | { |
||
| 30 | if ($this->isLocked) { |
||
| 31 | // schema is locked, no more inferring is needed |
||
| 32 | return parent::castRow($row); |
||
| 33 | } else { |
||
| 34 | // add the row to the inferrer, update the descriptor according to the best inferred fields |
||
| 35 | $this->fieldsInferer->addRows([$row]); |
||
| 36 | $this->descriptor->fields = []; |
||
| 37 | foreach ($this->fieldsInferer->infer() as $fieldName => $inferredField) { |
||
| 38 | /** @var Fields\BaseField $inferredField */ |
||
| 39 | $this->descriptor->fields[] = $inferredField->descriptor(); |
||
| 40 | } |
||
| 41 | $this->castRows = $this->fieldsInferer->castRows(); |
||
| 42 | return $this->castRows[count($this->castRows)-1]; |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 55 | } |