PhpSpec\Wrapper\Subject\Caller::newInstanceWithArguments PHP Method

newInstanceWithArguments() private method

private newInstanceWithArguments ( ReflectionClass $reflection ) : object
$reflection ReflectionClass
return object
    private function newInstanceWithArguments(ReflectionClass $reflection)
    {
        try {
            return $reflection->newInstanceArgs($this->wrappedObject->getArguments());
        } catch (ReflectionException $e) {
            if ($this->detectMissingConstructorMessage($e)) {
                throw $this->methodNotFound('__construct', $this->wrappedObject->getArguments());
            }
            throw $e;
        }
    }