public function init() { if (!$this->isInitialized) { $this->reload(); } if (!$this->di->isStored($this)) { $this->di->store($this); } }
public function init() { $this->_di->store($this); }
/** * Add annotations namespace. * Every added namespace will be included in annotation name resolving for current instance. * * @param string $ns * @renturn Addendum */ public function addNamespace($ns) { NameNormalizer::normalize($ns, false); if (!in_array($ns, $this->namespaces)) { $before = count($this->namespaces); $this->namespaces[] = $ns; $this->namespaces = array_unique($this->namespaces); $after = count($this->namespaces); if ($after !== $before) { $this->nameKeys = array_flip($this->namespaces); Cache\NsCache::$addeNs = true; } $this->di->store($this, [], true); // Reconfigure flyweight instances if present if (!empty(self::$addendums[$this->instanceId])) { self::$addendums[$this->instanceId]->di->configure(self::$addendums[$this->instanceId]); } } return $this; }