public function resolveVersionAlias(string $alias) : ?string
    {
        if ($this->migrationRepository->hasVersion($alias)) {
            return $alias;
        }

        switch ($alias) {
            case self::ALIAS_FIRST:
                return '0';
            case self::ALIAS_CURRENT:
                return $this->migrationRepository->getCurrentVersion();
            case self::ALIAS_PREV:
                return $this->migrationRepository->getPrevVersion();
            case self::ALIAS_NEXT:
                return $this->migrationRepository->getNextVersion();
            case self::ALIAS_LATEST:
                return $this->migrationRepository->getLatestVersion();
            default:
                if (substr($alias, 0, 7) === self::ALIAS_CURRENT) {
                    return $this->migrationRepository->getDeltaVersion(substr($alias, 7));
                }

                return null;
        }
    }