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;
}