typesByNumber[$i] = [ 'num' => $line[2] . str_pad($i, 3, '0', STR_PAD_LEFT), 'type' => $line[3], 'low' => (int)(isset($line[4]) ? $line[4] : $defaultLow), ]; } } } public function getByNumber($id) { return $this->typesByNumber[$id] ?? [ 'num' => '??'.$id, 'type' => '?', 'low' => NULL, ]; } }