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