/** * Initialize the annotation. */ public function initAnnotation($properties) { $this->_map($properties, array('type', 'method')); parent::initAnnotation($properties); if (!isset($this->type)) { throw new AnnotationException('type property not set'); } }
/** * Initialize the annotation. */ public function initAnnotation($properties) { $this->_map($properties, array('values')); parent::initAnnotation($properties); if (!isset($this->values)) { throw new AnnotationException('EnumAnnotation requires a list of possible values'); } }
/** * Initialize the annotation. */ public function initAnnotation($properties) { $this->_map($properties, array('pattern')); parent::initAnnotation($properties); if (!isset($this->pattern)) { throw new AnnotationException('PatternAnnotation requires a pattern property'); } }
/** * Initialize the annotation. */ public function initAnnotation($properties) { if (isset($properties[0])) { if (isset($properties[1])) { $this->min = $properties[0]; $this->max = $properties[1]; unset($properties[1]); } else { $this->max = $properties[0]; } unset($properties[0]); } parent::initAnnotation($properties); if ($this->min !== null && !is_int($this->min) && !is_float($this->min)) { throw new AnnotationException('RangeAnnotation requires a numeric (float or int) min property'); } if ($this->max !== null && !is_int($this->max) && !is_float($this->max)) { throw new AnnotationException('RangeAnnotation requires a numeric (float or int) max property'); } if ($this->min === null && $this->max === null) { throw new AnnotationException('RangeAnnotation requires a min and/or max property'); } }
/** * Initialize the annotation. */ public function initAnnotation($properties) { if (isset($properties[0])) { if (isset($properties[1])) { $this->min = $properties[0]; $this->max = $properties[1]; unset($properties[1]); } else { $this->max = $properties[0]; } unset($properties[0]); } parent::initAnnotation($properties); if ($this->min !== null && !is_int($this->min)) { throw new AnnotationException('LengthAnnotation requires an (integer) min property'); } if ($this->max !== null && !is_int($this->max)) { throw new AnnotationException('LengthAnnotation requires an (integer) max property'); } if ($this->min === null && $this->max === null) { throw new AnnotationException('LengthAnnotation requires a min and/or max property'); } }