private function processContentLength() { $length = strlen($this->content()); if (!$this->headers->has('Content-Length') || $this->headers->fetch('Content-Length') != $length) { $this->headers->write('Content-Length', $length); } }
/** * Merges the collection with another collection. * * @param CollectionInterface $in * * @return CollectionInterface */ public function merge(CollectionInterface $in) : CollectionInterface { return new static(array_merge($this->items, $in->all())); }
/** * Create a new cookie. * * @param string $key * @param mixed $value * @param \DateTimeImmutable $expiration * @param array $options * * @return CookieInterface */ public function create(string $key, string $value, \DateTimeImmutable $expiration = null, array $options = []) : CookieInterface { $options = array_merge($this->options, $options); $this->collection->write($key, ['value' => $value, 'expiration' => $expiration, 'attributes' => $options]); return new Cookie($key, $value); }