3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Form\Annotation
;
12 use Zend\Form\Exception
;
14 abstract class AbstractArrayOrStringAnnotation
22 * Receive and process the contents of an annotation
25 * @throws Exception\DomainException if a 'value' key is missing, or its value is not an array or string
27 public function __construct(array $data)
29 if (!isset($data['value']) ||
(!is_array($data['value']) && !is_string($data['value']))) {
30 throw new Exception\
DomainException(sprintf(
31 '%s expects the annotation to define an array or string; received "%s"',
33 isset($data['value']) ?
gettype($data['value']) : 'null'
36 $this->value
= $data['value'];