public function createWithConstructorParams(array $params, $config = []) {
        $definition = $this->prepareObjectDefinitionFromConfig($config);

        return $this->getContainer()->create($definition, $params);
    }
public function createWithConstructorParams(array $params, $config = []) {
        $definition = $this->prepareObjectDefinitionFromConfig($config);

        return $this->getContainer()->create($definition, $params);
    }
public function createWithConstructorParams ( array $ params , $ config = [ ] ) { $ definition = $ this -> prepareObjectDefinitionFromConfig ( $ config ) ; return $ this -> getContainer ( ) -> create ( $ definition , $ params ) ; }
Creates a new object with specified constructor parameters using the given or default configuration.

@param array $params the constructor parameters
@param array $config a configuration array of the name-value pairs that will be used to initialize
the corresponding object properties

@return object the created object
@throws \yii\base\InvalidConfigException if the configuration is invalid.
@see \PHPKitchen\DI\Container
Creates a new object with specified constructor parameters using the given or default configuration .