Skip to content

Commit

Permalink
Merge pull request #7 from netlogix/feature/allow-verson-numbers-in-f…
Browse files Browse the repository at this point in the history
…ull-namespace

FEATURE: Allow version numbers in full namespace
  • Loading branch information
paxuclus authored Nov 11, 2020
2 parents 1274eb6 + 79d7f75 commit 3d3ca79
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Classes/Domain/Service/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ class VersionResolver
{
public function extractVersion(string $migrationClassName): string
{
preg_match('#\\Version(\d+)$#', $migrationClassName, $matches);
return $matches[1];
/*
* date format version number:
* 4 digits year
* + 2 digits month
* + 2 digits day
* + 2 digits hour
* + 2 digits minute
* + 2 digits second
* = 14 digits
*/
preg_match('#\\\\Version(?<dateFormatVersionNumber>\\d{14})(\\\\|$)#', $migrationClassName, $matches);
return $matches['dateFormatVersionNumber'];
}
}

0 comments on commit 3d3ca79

Please sign in to comment.