/** * @param string $name * @throws \Janeiro\Di\Exception * @return self */ public function setName($name) { $this->name = $name; if (is_string($this->item)) { $this->container->map($this->item, $name); } elseif (is_object($this->item)) { $this->container->map(get_class($this->item), $name); } return $this; }