/** * {@inheritdoc} * * @throws \LogicException */ public function setCookie(Cookie $cookie) { if ($this->headerSent($file, $line)) { throw new \LogicException(sprintf("Headers is already sent in '%s:%s'", $file, $line)); } return parent::setCookie($cookie); }