예제 #1
0
 public function __construct(SetInterface $values)
 {
     $values->foreach(function (HeaderValueInterface $value) {
         if (!$value instanceof AcceptLanguageValue) {
             throw new InvalidArgumentException();
         }
     });
     parent::__construct('Accept-Language', $values);
 }
예제 #2
0
파일: Accept.php 프로젝트: innmind/http
 public function __construct(SetInterface $values)
 {
     if ($values->size() === 0) {
         throw new AcceptHeaderMustContainAtLeastOneValueException();
     }
     $values->foreach(function (HeaderValueInterface $value) {
         if (!$value instanceof AcceptValue) {
             throw new InvalidArgumentException();
         }
     });
     parent::__construct('Accept', $values);
 }
예제 #3
0
 public function __construct(SetInterface $values)
 {
     if ($values->size() === 0) {
         throw new CacheControlHeaderMustContainAtLeastOneValueException();
     }
     $values->foreach(function (HeaderValueInterface $header) {
         if (!$header instanceof CacheControlValueInterface) {
             throw new InvalidArgumentException();
         }
     });
     parent::__construct('Cache-Control', $values);
 }