src/mg/Ding/Bean/Provider/Annotation.php
protected function registerEventsFor(Collection $annotations, $beanName, $class)
    {
        $rClass = $this->reflectionFactory->getClass($class);
        if ($rClass->isAbstract()) {
            return;
        }
        $this->_registerEventsForBeanName($annotations, $beanName);
        while($rClass = $this->reflectionFactory->getClass($class)->getParentClass()) {
            $class = $rClass->getName();
            $annotations = $this->reflectionFactory->getClassAnnotations($rClass->getName());
            $this->_registerEventsForBeanName($annotations, $beanName);
        }
    }
protected function registerEventsFor(Collection $annotations, $beanName, $class)
    {
        $rClass = $this->reflectionFactory->getClass($class);
        if ($rClass->isAbstract()) {
            return;
        }
        $this->_registerEventsForBeanName($annotations, $beanName);
        while($rClass = $this->reflectionFactory->getClass($class)->getParentClass()) {
            $class = $rClass->getName();
            $annotations = $this->reflectionFactory->getClassAnnotations($rClass->getName());
            $this->_registerEventsForBeanName($annotations, $beanName);
        }
    }
Looks for @ListensOn and register the bean as an event listener. Since
this is an "early" discovery of a bean, a BeanDefinition is generated.

@param Collection $annotations Bean Annotations (for classes or methods)
@param string $beanName The target bean name.
@param string $class The bean class

@return void