| Conditions | 8 |
| Paths | 16 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function transform(array &$samples, ?array &$targets = null): void |
||
| 34 | { |
||
| 35 | foreach ($samples as &$sample) { |
||
| 36 | foreach ($sample as &$feature) { |
||
| 37 | $feature = is_numeric($feature) ? (float) $feature : $this->nonNumericPlaceholder; |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | if ($this->transformTargets && is_array($targets)) { |
||
| 42 | foreach ($targets as &$target) { |
||
| 43 | $target = is_numeric($target) ? (float) $target : $this->nonNumericPlaceholder; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 |