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

Applied StyleCi changes, updated php deps

This commit is contained in:
Dan Brown
2022-08-29 17:46:41 +01:00
parent e537d0c4e8
commit 1cc7c649dc
26 changed files with 435 additions and 526 deletions

View File

@@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Collection;
class ReferenceStore
{
/**
* Update the outgoing references for the given page.
*/
@@ -25,7 +24,7 @@ class ReferenceStore
->where('from_type', '=', (new Page())->getMorphClass())
->delete();
Page::query()->select(['id', 'html'])->chunk(100, function(Collection $pages) {
Page::query()->select(['id', 'html'])->chunk(100, function (Collection $pages) {
$this->updateForPages($pages->all());
});
}
@@ -44,7 +43,7 @@ class ReferenceStore
$parser = CrossLinkParser::createWithEntityResolvers();
$references = [];
$pageIds = array_map(fn(Page $page) => $page->id, $pages);
$pageIds = array_map(fn (Page $page) => $page->id, $pages);
Reference::query()
->where('from_type', '=', $pages[0]->getMorphClass())
->whereIn('from_id', $pageIds)
@@ -55,10 +54,10 @@ class ReferenceStore
foreach ($models as $model) {
$references[] = [
'from_id' => $page->id,
'from_id' => $page->id,
'from_type' => $page->getMorphClass(),
'to_id' => $model->id,
'to_type' => $model->getMorphClass(),
'to_id' => $model->id,
'to_type' => $model->getMorphClass(),
];
}
}
@@ -67,5 +66,4 @@ class ReferenceStore
Reference::query()->insert($referenceDataChunk);
}
}
}
}