public static function configure(IOInterface $io, CommitMsg $commitMsg)
{
$answer = $io->ask(HookQuestions::COMMIT_MSG_HOOK, HookQuestions::DEFAULT_TOOL_ANSWER);
$commitMsg = $commitMsg->setEnabled(new Enabled(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($answer)));
if (true === $commitMsg->isEnabled()) {
$regularExpressionAnswer = $io->ask(HookQuestions::COMMIT_MSG_REGULAR_EXPRESSION, HookQuestions::COMMIT_MSG_REGULAR_EXPRESSION_ANSWER);
$commitMsg = $commitMsg->addRegularExpression(new RegularExpression($regularExpressionAnswer));
}
return $commitMsg;
}