1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Framework: Fixed Laravel 11 upgrade test issues, updated phpstan

- Fixed failing tests due to Laravel 11 changes
- Updated phpstan to 3.x branch
- Removed some seemingly redundant comment code, which was triggering
  phpstan.
This commit is contained in:
Dan Brown
2025-01-11 13:22:49 +00:00
parent cf9ccfcd5b
commit 5bf75786c6
8 changed files with 42 additions and 79 deletions

View File

@@ -26,25 +26,19 @@ return new class extends Migration
*/
public function down(): void
{
$sm = Schema::getConnection()->getDoctrineSchemaManager();
$prefix = DB::getTablePrefix();
$pages = $sm->introspectTable($prefix . 'pages');
$books = $sm->introspectTable($prefix . 'books');
$chapters = $sm->introspectTable($prefix . 'chapters');
if ($pages->hasIndex('search')) {
if (Schema::hasIndex('pages', 'search')) {
Schema::table('pages', function (Blueprint $table) {
$table->dropIndex('search');
});
}
if ($books->hasIndex('search')) {
if (Schema::hasIndex('books', 'search')) {
Schema::table('books', function (Blueprint $table) {
$table->dropIndex('search');
});
}
if ($chapters->hasIndex('search')) {
if (Schema::hasIndex('chapters', 'search')) {
Schema::table('chapters', function (Blueprint $table) {
$table->dropIndex('search');
});

View File

@@ -26,25 +26,19 @@ return new class extends Migration
*/
public function down(): void
{
$sm = Schema::getConnection()->getDoctrineSchemaManager();
$prefix = DB::getTablePrefix();
$pages = $sm->introspectTable($prefix . 'pages');
$books = $sm->introspectTable($prefix . 'books');
$chapters = $sm->introspectTable($prefix . 'chapters');
if ($pages->hasIndex('name_search')) {
if (Schema::hasIndex('pages', 'name_search')) {
Schema::table('pages', function (Blueprint $table) {
$table->dropIndex('name_search');
});
}
if ($books->hasIndex('name_search')) {
if (Schema::hasIndex('books', 'name_search')) {
Schema::table('books', function (Blueprint $table) {
$table->dropIndex('name_search');
});
}
if ($chapters->hasIndex('name_search')) {
if (Schema::hasIndex('chapters', 'name_search')) {
Schema::table('chapters', function (Blueprint $table) {
$table->dropIndex('name_search');
});

View File

@@ -25,27 +25,21 @@ return new class extends Migration
$table->index('score');
});
$sm = Schema::getConnection()->getDoctrineSchemaManager();
$prefix = DB::getTablePrefix();
$pages = $sm->introspectTable($prefix . 'pages');
$books = $sm->introspectTable($prefix . 'books');
$chapters = $sm->introspectTable($prefix . 'chapters');
if ($pages->hasIndex('search')) {
if (Schema::hasIndex('pages', 'search')) {
Schema::table('pages', function (Blueprint $table) {
$table->dropIndex('search');
$table->dropIndex('name_search');
});
}
if ($books->hasIndex('search')) {
if (Schema::hasIndex('books', 'search')) {
Schema::table('books', function (Blueprint $table) {
$table->dropIndex('search');
$table->dropIndex('name_search');
});
}
if ($chapters->hasIndex('search')) {
if (Schema::hasIndex('chapters', 'search')) {
Schema::table('chapters', function (Blueprint $table) {
$table->dropIndex('search');
$table->dropIndex('name_search');