private function getParameters(callable $callback)
    {
        if (is_array($callback)) {
            $mirror = new ReflectionMethod($callback[0], $callback[1]);
        } elseif (is_object($callback) && !$callback instanceof \Closure) {
            /** @var object $callback */
            $mirror = new ReflectionObject($callback);
            $mirror = $mirror->getMethod('__invoke');
        } else {
            $mirror = new ReflectionFunction($callback);
        }

        return $mirror->getParameters();
    }