public function generate()
{
$version = $this->getMode();
$method = 'createIdVersion' . $version;
if (!method_exists($this, $method)) {
throw new UnknownGeneratorVersionException(['version' => $version]);
}
try {
if (in_array($version, [3, 5])) {
return $this->{$method}($this->config['namespace']);
}
return $this->{$method}();
} catch (UnsatisfiedDependencyException $e) {
throw $e;
}
}