コード例 #1
0
ファイル: AcceptLanguage.php プロジェクト: innmind/http
 public function __construct(SetInterface $values)
 {
     $values->foreach(function (HeaderValueInterface $value) {
         if (!$value instanceof AcceptLanguageValue) {
             throw new InvalidArgumentException();
         }
     });
     parent::__construct('Accept-Language', $values);
 }
コード例 #2
0
ファイル: CacheControl.php プロジェクト: innmind/http
 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);
 }
コード例 #3
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);
 }
コード例 #4
0
ファイル: ContentEncoding.php プロジェクト: innmind/http
 public function __construct(ContentEncodingValue $encoding)
 {
     parent::__construct('Content-Encoding', (new Set(HeaderValueInterface::class))->add($encoding));
 }
コード例 #5
0
ファイル: ContentLocation.php プロジェクト: innmind/http
 public function __construct(LocationValue $location)
 {
     parent::__construct('Content-Location', (new Set(HeaderValueInterface::class))->add($location));
 }
コード例 #6
0
ファイル: Range.php プロジェクト: innmind/http
 public function __construct(RangeValue $range)
 {
     parent::__construct('Range', (new Set(HeaderValueInterface::class))->add($range));
 }
コード例 #7
0
ファイル: Host.php プロジェクト: innmind/http
 public function __construct(HostValue $host)
 {
     parent::__construct('Host', (new Set(HeaderValueInterface::class))->add($host));
 }
コード例 #8
0
ファイル: Authorization.php プロジェクト: innmind/http
 public function __construct(AuthorizationValue $authorization)
 {
     parent::__construct('Authorization', (new Set(HeaderValueInterface::class))->add($authorization));
 }
コード例 #9
0
ファイル: Expires.php プロジェクト: innmind/http
 public function __construct(DateValue $date)
 {
     parent::__construct('Expires', (new Set(HeaderValueInterface::class))->add($date));
 }
コード例 #10
0
ファイル: ContentType.php プロジェクト: innmind/http
 public function __construct(ContentTypeValue $content)
 {
     parent::__construct('Content-Type', (new Set(HeaderValueInterface::class))->add($content));
 }
コード例 #11
0
ファイル: AcceptRanges.php プロジェクト: innmind/http
 public function __construct(AcceptRangesValue $ranges)
 {
     parent::__construct('Accept-Ranges', (new Set(HeaderValueInterface::class))->add($ranges));
 }
コード例 #12
0
ファイル: IfUnmodifiedSince.php プロジェクト: innmind/http
 public function __construct(DateValue $date)
 {
     parent::__construct('If-Unmodified-Since', (new Set(HeaderValueInterface::class))->add($date));
 }
コード例 #13
0
ファイル: ContentLength.php プロジェクト: innmind/http
 public function __construct(ContentLengthValue $length)
 {
     parent::__construct('Content-Length', (new Set(HeaderValueInterface::class))->add($length));
 }
コード例 #14
0
ファイル: Referrer.php プロジェクト: innmind/http
 public function __construct(ReferrerValue $referrer)
 {
     parent::__construct('Referer', (new Set(HeaderValueInterface::class))->add($referrer));
 }
コード例 #15
0
ファイル: LastModified.php プロジェクト: innmind/http
 public function __construct(DateValue $date)
 {
     parent::__construct('Last-Modified', (new Set(HeaderValueInterface::class))->add($date));
 }