File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments