Conditions | 8 |
Paths | 16 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 | } |
||
48 |