protected function castEach(iterable $array)
    {
        if (!isset($this->typecast)) {
            throw new LogicException("Typecast for array handler not set");
        }

        foreach ($array as &$item) {
            $item = $this->typecast->to($this->subtype)->cast($item);
        }

        return $array;
    }