top-think/think-migration

topthink/think-migration/phinx/src/Phinx/Util/Util.php:109

Opened this issue · 1 comments

$fileName = static::getCurrentTimestamp() . '' . strtolower(implode($arr, '')) . '.php';
??
implode(): Passing glue string after array is deprecated. Swap the parameters
--> implode( '_', $arr )

jenqz commented

me too, my php version is 7.4, please fix it ASAP.
the newest method in Util.php of Phinx project has been changed like below:

public static function mapClassNameToFileName($className)
    {
        $snake = function ($matches) {
            return '_' . strtolower($matches[0]);
        };
        $fileName = preg_replace_callback('/\d+|[A-Z]/', $snake, $className);
        $fileName = static::getCurrentTimestamp() . "$fileName.php";

        return $fileName;
    }