protected function applyTransform($transform) { if (is_callable($transform)) { return call_user_func_array($transform, array_slice(func_get_args(), 1)); } else { throw new RuntimeException("Argument to applyTransform must be callable"); } }