Skip to content

Commit d06758e

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Migration.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,18 @@ public function getMigrationSql($version, $increment)
101101
// I could use the GLOB_BRACE but it is not supported on ALPINE distros.
102102
// So, I have to call multiple times to simulate the braces.
103103

104+
if (intval($version) != $version) {
105+
throw new \InvalidArgumentException("Version '$version' should be a integer number");
106+
}
107+
$version = intval($version);
108+
104109
$filePattern = $this->_folder
105110
. "/migrations"
106111
. "/" . ($increment < 0 ? "down" : "up")
107112
. "/*%s.sql";
108113

109114
$result = array_merge(
110-
glob(sprintf($filePattern, $version)),
115+
glob(sprintf($filePattern, "$version")),
111116
glob(sprintf($filePattern, "$version-dev"))
112117
);
113118

@@ -117,7 +122,7 @@ public function getMigrationSql($version, $increment)
117122
}
118123

119124
foreach ($result as $file) {
120-
if (intval(basename($file)) == $version) {
125+
if (intval(basename($file)) === $version) {
121126
return $file;
122127
}
123128
}

0 commit comments

Comments
 (0)