/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $help = $options['help']; if ($help === null && $builder->hasParent()) { $parentClass = $builder->getParent()->getOption('data_class'); $fieldName = $builder->getName(); if ($parentClass !== null) { $reflector = new ReflectionProperty($parentClass, $fieldName); $annot = $this->reader->getPropertyAnnotation($reflector, 'Tg\\OkoaBundle\\Form\\Annotation\\Help'); if ($annot !== null) { $help = $annot->value; } } } $builder->setAttribute('help', $help); }