src/Types/ArrayType.php
public function set($value)
    {
        if (!is_array($value)) {
            throw new \InvalidArgumentException('An indexed array was expected');
        }

        $keys       = array_keys($value);
        $length     = count($value);

        // Empty arrays must be handled with care.
        if (!$length) {
            $numeric = array();
        } else {
            $numeric = range(0, $length - 1);
            sort($keys);
        }

        // Detect associative arrays (which are invalid for this type).
        if ($keys !== $numeric) {
            throw new \InvalidArgumentException('An indexed array was expected');
        }

        foreach ($value as $val) {
            if (!($val instanceof \fpoirotte\XRL\Types\AbstractType)) {
                throw new \InvalidArgumentException('A valid XML-RPC type was expected');
            }
        }

        $this->value = $value;
    }
public function set($value)
    {
        if (!is_array($value)) {
            throw new \InvalidArgumentException('An indexed array was expected');
        }

        $keys       = array_keys($value);
        $length     = count($value);

        // Empty arrays must be handled with care.
        if (!$length) {
            $numeric = array();
        } else {
            $numeric = range(0, $length - 1);
            sort($keys);
        }

        // Detect associative arrays (which are invalid for this type).
        if ($keys !== $numeric) {
            throw new \InvalidArgumentException('An indexed array was expected');
        }

        foreach ($value as $val) {
            if (!($val instanceof \fpoirotte\XRL\Types\AbstractType)) {
                throw new \InvalidArgumentException('A valid XML-RPC type was expected');
            }
        }

        $this->value = $value;
    }
/ \copydoc fpoirotte::XRL::Types::AbstractType::set()