Skip to content

Commit 629ce2b

Browse files
committed
Ensure any version with dev in it is prepended with 0.0.1-
1 parent 9fb84f1 commit 629ce2b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ApiSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static function getVersion(string $version = ''): string
2020

2121
list($version, $hash) = explode('@', $version);
2222

23-
if (substr($version, -4) === '-dev') {
23+
if (strpos($version, 'dev') !== false) {
2424
return '0.0.1-' . $hash;
2525
}
2626

tests/ApiSettingsTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public function getVersionProvider()
1414
'0.0.1-abcdefghijklopqrstuwxyz',
1515
];
1616

17+
yield [
18+
'dev@xyz',
19+
'0.0.1-xyz',
20+
];
21+
1722
yield [
1823
'1.0.0@abcdefghijklopqrstuwxyz',
1924
'1.0.0',

0 commit comments

Comments
 (0)