Inspekt\AccessorAbstract::walkArray PHP Method

walkArray() protected method

If an array is the value of the given key, this method walks the array recursively, applying $this->inspekt on any non-array values
Author: Ed Finkler
protected walkArray ( mixed $input ) : mixed
$input mixed
return mixed
    protected function walkArray($input)
    {
        if (!Inspekt::isArrayOrArrayObject($input)) {
            throw new Exception('$input must be an array or ArrayObject');
        }
        foreach ($input as $key => $val) {
            if (Inspekt::isArrayOrArrayObject($val)) {
                $input[$key] = $this->walkArray($val);
            } else {
                $val = $this->inspekt($val);
                $input[$key] = $val;
            }
        }
        return $input;
    }