protected function extractCallParametersFromMagicCall($method, array $arguments)
    {
        if (count($arguments) < 1) {
            throw new \InvalidArgumentException(sprintf(
                '"%s" must be called with at least one argument denoting the path', $method
            ));
        }

        $path   = array_shift($arguments);
        $args   = array();
        $stdIn  = null;

        if (count($arguments) > 0) {
            $args   = array_shift($arguments);
            if (!is_array($args)) {
                $args   = array($args);
            }

            if (count($arguments) > 0) {
                $stdIn  = array_shift($arguments);
                if (!is_string($stdIn)) {
                    $stdIn   = null;
                }
            }
        }
        return array($path, $method, $args, $stdIn);
    }