diff --git a/Updated_Cms/database/migrations/2014_01_01_000000_core_sql_file.php b/Updated_Cms/database/migrations/2014_01_01_000000_core_sql_file.php index d409ee91a9..96e5a03e5d 100644 --- a/Updated_Cms/database/migrations/2014_01_01_000000_core_sql_file.php +++ b/Updated_Cms/database/migrations/2014_01_01_000000_core_sql_file.php @@ -13,7 +13,7 @@ class CoreSqlFile extends Migration * * @return void */ - public function up() + public function up(): void { // Only run in testing environment if (app()->environment() !== 'testing') { @@ -31,10 +31,14 @@ class CoreSqlFile extends Migration $sqlFile = database_path('migrations/sqls/default.sql'); $sql = file_get_contents($sqlFile); + if (! is_string($sql)) { + return; + } // Split into individual statements to show progress + $split = preg_split('/;\s*\n/', $sql) ?: []; $statements = array_filter( - preg_split('/;\s*\n/', $sql), + $split, fn ($stmt) => ! empty(trim($stmt)) && ! str_starts_with(trim($stmt), '--') && ! str_starts_with(trim($stmt), '/*'),