/** * Menus constructor. * * @param \Codex\Codex $parent * @param \Illuminate\Routing\Router $router * @param \Illuminate\Contracts\Routing\UrlGenerator $url * @param \Illuminate\Contracts\View\View $view */ public function __construct(Codex $parent, Router $router, Cache $cache, UrlGenerator $url, View $view) { parent::__construct(); $this->setCodex($parent); $this->setFiles($parent->getFiles()); $this->cache = $cache; $this->router = $router; $this->url = $url; $this->view = $view; $this->hookPoint('menus:constructed', [$this]); }
/** * Projects constructor. * * @param \Codex\Codex $parent * @param \Laradic\Support\Filesystem $files */ public function __construct(Project $parent) { parent::__construct(); $this->setCodex($parent->getCodex()); $this->setContainer($parent->getContainer()); $this->setFiles($parent->getFiles()); $this->project = $parent; $this->hookPoint('refs:construct', [$this]); $this->resolveRefs(); $this->hookPoint('refs:constructed', [$this]); }
/** * Gets a project by name * * @param string $name The project name * * @return \Codex\Projects\Project * @throws \Codex\Exception\CodexException */ public function get($name) { if (!$this->has($name)) { throw CodexException::projectNotFound((string) $name); } return parent::get($name); }