public function createInstance(Definition $serviceConf, $container) { // decode the argument list $params = (array) $this->normalize($serviceConf->getArguments(), $container); if ($serviceConf->hasFactory()) { $instance = $this->createFromFactory($serviceConf->getFactory(), $params, $container); } else { $class = new \ReflectionClass($serviceConf->getClass()); // create the instance $instance = $class->newInstanceArgs($params); } return $instance; }