示例#1
0
 /**
  * HeaderBag constructor.
  *
  * @param array $headers
  */
 public function __construct(array $headers)
 {
     $bag = [];
     $self = $this;
     array_walk($headers, function ($value, $key) use(&$bag, $self) {
         $value = explode(',', $value);
         $self->headers[$key] = $value;
         $key = str_replace(['http_', '_'], ['', '-'], strtolower($key));
         $bag[$key] = $value;
     });
     parent::__construct($bag);
 }
示例#2
0
 /**
  * ServerAttribute constructor.
  * @param array $bag
  */
 public function __construct(array $bag)
 {
     parent::__construct($bag);
 }