protected function __construct(array $params) { $this->squirtServiceConfigLoader = SquirtUtil::validateParamClassWithDefault('squirtServiceConfigLoader', 'Squirt\\ServiceBuilder\\SquirtServiceConfigLoader', $params, function () use($params) { /* * Pass through parameters as these two classes are tightly * coupled and can use each other's configurations */ return SquirtServiceConfigLoader::factory($params); }); /* * Load any file based configuration */ if (array_key_exists('fileName', $params)) { $serviceConfig = $this->squirtServiceConfigLoader->loadFile($params['fileName']); $this->serviceConfig = ServiceBuilderUtil::mergeConfig($this->serviceConfig, $serviceConfig); } /* * Load any literal configuration passed */ if (array_key_exists('config', $params)) { $serviceConfig = $this->squirtServiceConfigLoader->loadConfig($params['config']); $this->serviceConfig = ServiceBuilderUtil::mergeConfig($this->serviceConfig, $serviceConfig); } }
public function testInstantiate() { $squirtServiceConfigLoader = SquirtServiceConfigLoader::factory(); $this->assertInstanceOf('Squirt\\ServiceBuilder\\SquirtServiceConfigLoader', $squirtServiceConfigLoader); return $squirtServiceConfigLoader; }