/** * @param BreadCrumb[] $crumbs * @return BreadCrumb[] */ private function saveCrumbs($crumbs) { $this->cookies->write(new Cookie(array_map(function (BreadCrumb $crumb) { return ['caption' => $crumb->getCaption(), 'target' => $crumb->getTarget()]; }, $crumbs)), self::COOKIE_KEY); return $crumbs; }
private function whenIUpdateTheCookie($name) { $this->store->write($this->cookie, $name); $this->apply($this->store); }