parse($data); } /** * @param array $data * @return Tool[] */ public function parse(array $data): array { $tools = []; foreach ($data as $T => $tool) { $T = (int)filter_var($T, FILTER_SANITIZE_NUMBER_INT); $tools[] = new Tool($T, $tool['X'], $tool['Z']); } return $tools; } }