src/mg/Ding/Bean/Factory/Driver/AnnotationRequiredDriver.php
public function afterDefinition(BeanDefinition $bean)
    {
        $class = $bean->getClass();
        $rClass = $this->reflectionFactory->getClass($class);
        $annotations = $this->reflectionFactory->getClassAnnotations($class);
        $props = $bean->getProperties();
        foreach ($rClass->getMethods() as $rMethod) {
            $methodName = $rMethod->getName();
            if (strpos($methodName, 'set') !== 0) {
                continue;
            }
            $annotations = $this->reflectionFactory->getMethodAnnotations($class, $methodName);
            if (!$annotations->contains('required')) {
                continue;
            }
            $propName = lcfirst(substr($methodName, 3));
            if (!isset($props[$propName])) {
                throw new BeanFactoryException('Missing @Required property: ' . $methodName);
            }
        }
        return $bean;
    }
public function afterDefinition(BeanDefinition $bean)
    {
        $class = $bean->getClass();
        $rClass = $this->reflectionFactory->getClass($class);
        $annotations = $this->reflectionFactory->getClassAnnotations($class);
        $props = $bean->getProperties();
        foreach ($rClass->getMethods() as $rMethod) {
            $methodName = $rMethod->getName();
            if (strpos($methodName, 'set') !== 0) {
                continue;
            }
            $annotations = $this->reflectionFactory->getMethodAnnotations($class, $methodName);
            if (!$annotations->contains('required')) {
                continue;
            }
            $propName = lcfirst(substr($methodName, 3));
            if (!isset($props[$propName])) {
                throw new BeanFactoryException('Missing @Required property: ' . $methodName);
            }
        }
        return $bean;
    }
(non-PHPdoc)
@see Ding\Bean\Lifecycle.IAfterDefinitionListener::afterDefinition()