Ejemplo n.º 1
0
 /**
  * @inheritDoc
  *
  * @throws DirectoryException If a value is not an Action instance
  */
 public function validate(array $data)
 {
     parent::validate($data);
     foreach ($data as $value) {
         if (!is_object($value) || !$value instanceof Action) {
             throw DirectoryException::invalidEntry($value);
         }
     }
 }
Ejemplo n.º 2
0
 public function validate(array $data)
 {
     parent::validate($data);
     foreach ($data as $class) {
         if (!class_exists($class)) {
             throw new \InvalidArgumentException('Cannot add non-class value to ClassDictionary');
         }
     }
 }
 /**
  * @inheritDoc
  */
 public function __construct(array $data = [])
 {
     $data += ['text/html' => PrettyPageHandler::class, 'application/javascript' => JsonResponseHandler::class, 'application/json' => JsonResponseHandler::class, 'application/ld+json' => JsonResponseHandler::class, 'application/vnd.api+json' => JsonResponseHandler::class, 'application/vnd.geo+json' => JsonResponseHandler::class, 'application/xml' => XmlResponseHandler::class, 'application/atom+xml' => XmlResponseHandler::class, 'application/rss+xml' => XmlResponseHandler::class, 'text/plain' => PlainTextHandler::class];
     // @codeCoverageIgnore
     parent::__construct($data);
 }