protected static function walkArray($input, $method, $classname = null)
{
if (!isset($classname)) {
$classname = __CLASS__;
}
if (!self::isArrayOrArrayObject($input)) {
throw new Exception('$input must be an array or ArrayObject');
}
if (!is_callable(array($classname, $method))) {
throw new Exception('Inspektor ' . $classname . '::' . $method . ' is invalid');
}
foreach ($input as $key => $val) {
if (is_array($val)) {
$input[$key] = self::walkArray($val, $method, $classname);
} else {
$val = call_user_func(array($classname, $method), $val);
$input[$key] = $val;
}
}
return $input;
}