Nelmio\Alice\Generator\Instantiator\Chainable\StaticFactoryInstantiator::createInstance PHP Method

createInstance() protected method

protected createInstance ( Nelmio\Alice\FixtureInterface $fixture )
$fixture Nelmio\Alice\FixtureInterface
    protected function createInstance(FixtureInterface $fixture)
    {
        $constructor = $fixture->getSpecs()->getConstructor();
        list($class, $factory, $method, $arguments) = [$fixture->getClassName(), $constructor->getCaller()->getId(), $constructor->getMethod(), $constructor->getArguments()];
        if (null === $arguments) {
            $arguments = [];
        }
        $instance = $factory::$method(...$arguments);
        if (false === $instance instanceof $class) {
            throw InstantiationExceptionFactory::createForInvalidInstanceType($fixture, $instance);
        }
        return $instance;
    }
StaticFactoryInstantiator