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;
    }
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;
    }
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 ; }
Cast each value of the array.

@param iterable $array
@return iterable
@throws LogicException if typecast is not set
Cast each value of the array .