public function getListenerInfo($listener)
    {
        $info = array();

        if(is_callable($listener))
        {
            if (get_class('Closure') && $listener instanceof Closure)
            {
                $info += array(
                    'type'   => 'Closure',
                    'pretty' => 'closure'
                );
            }

            if (is_string($listener))
            {
                try
                {
                    $r = new ReflectionFunction($listener);
                    $file = $r->getFileName();
                    $line = $r->getStartLine();
                }
                catch (ReflectionException $e)
                {
                    $file = null;
                    $line = null;
                }

                $info += array
                (
                    'type'  => 'Function',
                    'function' => $listener,
                    'file'  => $file,
                    'line'  => $line,
                    'pretty' => $listener,
                );
            }

            if (is_array($listener) || (is_object($listener)))
            {
                if (!is_array($listener)) {
                    $listener = array($listener, '__invoke');
                }

                $class = is_object($listener[0]) ? get_class($listener[0]) : $listener[0];

                try
                {
                    $r = new ReflectionMethod($class, $listener[1]);
                    $file = $r->getFileName();
                    $line = $r->getStartLine();
                }
                catch (ReflectionException $e)
                {
                    $file = null;
                    $line = null;
                }

                $info += array
                (
                    'type'   => 'Method',
                    'class'  => $class,
                    'method' => $listener[1],
                    'file'   => $file,
                    'line'   => $line,
                    'pretty' => $class.'::'.$listener[1],
                );
            }
        }

        return $info;
    }