Skip to content

Commit 6296c71

Browse files
committed
Try to fix travis.
1 parent d06758e commit 6296c71

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Migration.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,16 @@ public function getCurrentVersion()
185185
protected function canContinue($currentVersion, $upVersion, $increment)
186186
{
187187
$existsUpVersion = ($upVersion !== null);
188-
$compareVersion = strcmp(
189-
str_pad($currentVersion, 10, '0', STR_PAD_LEFT),
190-
str_pad($upVersion, 10, '0', STR_PAD_LEFT)
191-
) == $increment;
188+
$compareVersion =
189+
intval($currentVersion) < intval($upVersion)
190+
? -1
191+
: (
192+
intval($currentVersion) > intval($upVersion)
193+
? 1
194+
: 0
195+
);
192196

193-
return !($existsUpVersion && $compareVersion);
197+
return !($existsUpVersion && ($compareVersion === intval($increment)));
194198
}
195199

196200
/**

0 commit comments

Comments
 (0)