/** * */ public function parseConfig() { parent::parseConfig(); if (is_array($this->config['namespaces']) && !empty($this->config['namespaces'])) { $this->namespaces = array_merge($this->namespaces, $this->config['namespaces']); } }
/** * Add the parentClass option to have a default fallback class if specified class not found in the namespace * config * * @throws \InvalidArgumentException */ public function parseConfig() { parent::parseConfig(); if (empty($this->config['parentClass'])) { throw new \InvalidArgumentException("parentClass configuration option is required to use parent factory"); } $this->parentClass = $this->config['parentClass'] ?: null; $this->parentNamespace = $this->config['parentNamespace'] ?: $this->namespace; }
/** * This is used to fetch the dep injector on the adapter factory if we do not have one then we will * create one for you and assume the only deps are the standard settings. Yes, sir we are creating * super flexibility at the cost of some complexity in code....Suck it up and learn some shit. * * @param GenericInstanceFactory $adapterFactory * @param $settings */ public function getInjector(GenericInstanceFactory $adapterFactory, $settings) { $injector = $adapterFactory->getInjector(); if (!$injector) { $injector = new Injector(array("settings" => $settings)); } else { $injector->updateScope("settings", $settings); } return $injector; }