Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Form / Annotation / AbstractArrayOrStringAnnotation.php
blob15d799e226f35fdc277f4fb24459766ac75c23e1
1 <?php
2 /**
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
8 */
10 namespace Zend\Form\Annotation;
12 use Zend\Form\Exception;
14 abstract class AbstractArrayOrStringAnnotation
16 /**
17 * @var array|string
19 protected $value;
21 /**
22 * Receive and process the contents of an annotation
24 * @param array $data
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"',
32 get_class($this),
33 isset($data['value']) ? gettype($data['value']) : 'null'
34 ));
36 $this->value = $data['value'];