/** * 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; }