/** * * @param \Zoop\Shard\Annotation\AnnotationEventArgs $eventArgs */ public function annotationValidator(AnnotationEventArgs $eventArgs) { $annotation = $eventArgs->getAnnotation(); if ($eventArgs->getEventType() == EventType::DOCUMENT) { $this->setDocumentValidator($eventArgs, ['class' => $annotation->class, 'options' => $annotation->options]); } else { $this->setFieldValidator($eventArgs, ['class' => $annotation->class, 'options' => $annotation->options]); } }