$statuses статусы магазина: строки с ключами `id` и `name` * @param int $current значение из настроек — пункт с ним будет выбран * * @return array */ public static function build(array $statuses, int $current, string $firstLabel, int $firstValue): array { $options = [[$firstLabel, $firstValue, $current]]; foreach ($statuses as $status) { if (!is_array($status) || !isset($status['id'], $status['name'])) { continue; } $id = (int) $status['id']; if ($id !== $firstValue) { $options[] = [(string) $status['name'], $id, $current]; } } return $options; } }