protected function isSequence($value)
    {
        if (!Helper::isSequential($value)) {
            return false;
        }

        if ($value === []) {
            return true;
        }

        $i=0;

        $lastItemType = null;

        foreach ($value as $key=>$item) {

            if ($key !== $i) {
                return false;
            }

            $itemType = Type::of($item);

            // TODO: list could be typed by common class or interface
            if ($i !== 0 && $itemType != $lastItemType) {
                return false;
            }

            $lastItemType = $itemType;
            $i++;
        }

        return true;

    }
protected function isSequence($value)
    {
        if (!Helper::isSequential($value)) {
            return false;
        }

        if ($value === []) {
            return true;
        }

        $i=0;

        $lastItemType = null;

        foreach ($value as $key=>$item) {

            if ($key !== $i) {
                return false;
            }

            $itemType = Type::of($item);

            // TODO: list could be typed by common class or interface
            if ($i !== 0 && $itemType != $lastItemType) {
                return false;
            }

            $lastItemType = $itemType;
            $i++;
        }

        return true;

    }
protected function isSequence ( $ value ) { if ( ! Helper :: isSequential ( $ value ) ) { return false ; } if ( $ value === [ ] ) { return true ; } $ i = 0 ; $ lastItemType = null ; foreach ( $ value as $ key => $ item ) { if ( $ key !== $ i ) { return false ; } $ itemType = Type :: of ( $ item ) ; // TODO: list could be typed by common class or interface if ( $ i !== 0 && $ itemType != $ lastItemType ) { return false ; } $ lastItemType = $ itemType ; $ i ++ ; } return true ; }
Return true if the passed value is a sequence (array or class
which have strict numeric keys and every item type is the same.

@param mixed $value

@return bool
Return true if the passed value is a sequence ( array or class which have strict numeric keys and every item type is the same .