public function resolveAndCreate($namespace, ContainerInterface $container)
    {
        $class = new \ReflectionClass($namespace);
        $arguments = $this->resolveReflectionArguments($class, $container);

        return $class->newInstanceArgs($arguments);
    }
public function resolveAndCreate($namespace, ContainerInterface $container)
    {
        $class = new \ReflectionClass($namespace);
        $arguments = $this->resolveReflectionArguments($class, $container);

        return $class->newInstanceArgs($arguments);
    }
public function resolveAndCreate ( $ namespace , ContainerInterface $ container ) { $ class = new \ ReflectionClass ( $ namespace ) ; $ arguments = $ this -> resolveReflectionArguments ( $ class , $ container ) ; return $ class -> newInstanceArgs ( $ arguments ) ; }
Instantiate a new object using constructor injection.

@param string             $namespace
@param ContainerInterface $container

@return mixed
Instantiate a new object using constructor injection .