protected function callFactoryMethod($typeName, $factory, $methodName, array $resolvers = NULL, InjectionPointInterface $point = NULL)
	{
		$ref = new \ReflectionMethod(get_class($factory), $methodName);
		
		foreach($ref->getParameters() as $param)
		{
			if(Configuration::class === $this->getParamType($param))
			{
				$resolvers[$param->name] = $this->config->getConfig(str_replace('\\', '.', $typeName));
			}
		}
		
		$args = $this->populateArguments($ref, 0, $resolvers, $point);
		
		switch(count($args))
		{
			case 0:
				return $factory->$methodName();
			case 1:
				return $factory->$methodName($args[0]);
			case 2:
				return $factory->$methodName($args[0], $args[1]);
			case 3:
				return $factory->$methodName($args[0], $args[1], $args[2]);
			case 4:
				return $factory->$methodName($args[0], $args[1], $args[2], $args[3]);
		}
		
		return call_user_func_array([$factory, $methodName], $args);
	}
protected function callFactoryMethod($typeName, $factory, $methodName, array $resolvers = NULL, InjectionPointInterface $point = NULL)
	{
		$ref = new \ReflectionMethod(get_class($factory), $methodName);
		
		foreach($ref->getParameters() as $param)
		{
			if(Configuration::class === $this->getParamType($param))
			{
				$resolvers[$param->name] = $this->config->getConfig(str_replace('\\', '.', $typeName));
			}
		}
		
		$args = $this->populateArguments($ref, 0, $resolvers, $point);
		
		switch(count($args))
		{
			case 0:
				return $factory->$methodName();
			case 1:
				return $factory->$methodName($args[0]);
			case 2:
				return $factory->$methodName($args[0], $args[1]);
			case 3:
				return $factory->$methodName($args[0], $args[1], $args[2]);
			case 4:
				return $factory->$methodName($args[0], $args[1], $args[2], $args[3]);
		}
		
		return call_user_func_array([$factory, $methodName], $args);
	}
protected function callFactoryMethod ( $ typeName , $ factory , $ methodName , array $ resolvers = NULL , InjectionPointInterface $ point = NULL ) { $ ref = new \ ReflectionMethod ( get_class ( $ factory ) , $ methodName ) ; foreach ( $ ref -> getParameters ( ) as $ param ) { if ( Configuration :: class === $ this -> getParamType ( $ param ) ) { $ resolvers [ $ param -> name ] = $ this -> config -> getConfig ( str_replace ( '\\' , '.' , $ typeName ) ) ; } } $ args = $ this -> populateArguments ( $ ref , 0 , $ resolvers , $ point ) ; switch ( count ( $ args ) ) { case 0 : return $ factory -> $ methodName ( ) ; case 1 : return $ factory -> $ methodName ( $ args [ 0 ] ) ; case 2 : return $ factory -> $ methodName ( $ args [ 0 ] , $ args [ 1 ] ) ; case 3 : return $ factory -> $ methodName ( $ args [ 0 ] , $ args [ 1 ] , $ args [ 2 ] ) ; case 4 : return $ factory -> $ methodName ( $ args [ 0 ] , $ args [ 1 ] , $ args [ 2 ] , $ args [ 3 ] ) ; } return call_user_func_array ( [ $ factory , $ methodName ] , $ args ) ; }
Create an object instance by calling a factory method on an object.

@param string $typeName The bound type name of the target type.
@param object $factory The factory instance to be used.
@param string $methodName The name of the factory method to be called.
@param array<string, mixed> $resolvers Param resolvers applied to factory method arguments.
@param InjectionPointInterface $point Injection point that receives the generated object.
@return object The created object instance.
Create an object instance by calling a factory method on an object .