summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/FlashMessages.php2
-rw-r--r--app/Http/RequestHandlers/MapDataList.php2
-rw-r--r--app/Module/FamilyNavigatorModule.php7
-rw-r--r--app/Module/FamilyTreeFavoritesModule.php10
-rw-r--r--app/Module/FrequentlyAskedQuestionsModule.php14
-rw-r--r--app/Module/LifespansChartModule.php9
-rw-r--r--app/Module/RelativesTabModule.php3
-rw-r--r--app/Module/StoriesModule.php4
-rw-r--r--app/Module/TopSurnamesModule.php2
-rw-r--r--app/Module/UserFavoritesModule.php10
-rw-r--r--app/Services/PendingChangesService.php15
-rw-r--r--app/StatisticsData.php4
12 files changed, 63 insertions, 19 deletions
diff --git a/app/FlashMessages.php b/app/FlashMessages.php
index 75954787e7..fd421911ba 100644
--- a/app/FlashMessages.php
+++ b/app/FlashMessages.php
@@ -53,7 +53,7 @@ class FlashMessages
/**
* Get the current messages, and remove them from session storage.
*
- * @return array<object>
+ * @return array<object{text:string,status:string}>
*/
public static function getMessages(): array
{
diff --git a/app/Http/RequestHandlers/MapDataList.php b/app/Http/RequestHandlers/MapDataList.php
index cee8fe20e3..adc30de487 100644
--- a/app/Http/RequestHandlers/MapDataList.php
+++ b/app/Http/RequestHandlers/MapDataList.php
@@ -117,7 +117,7 @@ class MapDataList implements RequestHandlerInterface
return $this->viewResponse('admin/locations', [
'active' => $this->map_data_service->activePlaces($parent),
- 'all_trees' => $this->tree_service->all(),
+ 'all_trees' => $this->tree_service->all()->all(),
'breadcrumbs' => array_reverse($breadcrumbs),
'parent_id' => $parent_id,
'placelist' => $this->map_data_service->getPlaceListLocation($parent_id),
diff --git a/app/Module/FamilyNavigatorModule.php b/app/Module/FamilyNavigatorModule.php
index d368244c81..e968ca57f3 100644
--- a/app/Module/FamilyNavigatorModule.php
+++ b/app/Module/FamilyNavigatorModule.php
@@ -21,6 +21,8 @@ namespace Fisharebest\Webtrees\Module;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
+use Fisharebest\Webtrees\Registry;
+use Fisharebest\Webtrees\Services\RelationshipService;
class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInterface
{
@@ -67,6 +69,9 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter
*/
public function getSidebarContent(Individual $individual): string
{
- return view('modules/family_nav/sidebar', ['individual' => $individual]);
+ return view('modules/family_nav/sidebar', [
+ 'individual' => $individual,
+ 'relationship_service' => Registry::container()->get(RelationshipService::class),
+ ]);
}
}
diff --git a/app/Module/FamilyTreeFavoritesModule.php b/app/Module/FamilyTreeFavoritesModule.php
index 482f3aa587..f5ddb8a50f 100644
--- a/app/Module/FamilyTreeFavoritesModule.php
+++ b/app/Module/FamilyTreeFavoritesModule.php
@@ -116,13 +116,21 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt
*
* @param Tree $tree
*
- * @return array<object>
+ * @return array<int,object{
+ * favorite_id:string,
+ * favorite_type:string,
+ * url:string|null,
+ * note:string|null,
+ * title:string|null,
+ * record:GedcomRecord|null
+ * }>
*/
public function getFavorites(Tree $tree): array
{
return DB::table('favorite')
->where('gedcom_id', '=', $tree->id())
->whereNull('user_id')
+ ->select(['favorite_id', 'xref', 'favorite_type', 'url', 'title', 'note'])
->get()
->map(static function (object $row) use ($tree): object {
if ($row->xref !== null) {
diff --git a/app/Module/FrequentlyAskedQuestionsModule.php b/app/Module/FrequentlyAskedQuestionsModule.php
index 5c04cc95af..aafca4ef8a 100644
--- a/app/Module/FrequentlyAskedQuestionsModule.php
+++ b/app/Module/FrequentlyAskedQuestionsModule.php
@@ -122,7 +122,7 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleCon
return redirect(route(ControlPanel::class));
}
- $faqs = $this->faqsForTree($tree);
+ $faqs = $this->faqsForTree($tree)->all();
$min_block_order = (int) DB::table('block')
->where('module_name', '=', $this->name())
@@ -375,7 +375,8 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleCon
// Filter foreign languages.
$faqs = $this->faqsForTree($tree)
- ->filter(static fn (object $faq): bool => $faq->languages === '' || in_array(I18N::languageTag(), explode(',', $faq->languages), true));
+ ->filter(static fn (object $faq): bool => $faq->languages === '' || in_array(I18N::languageTag(), explode(',', $faq->languages), true))
+ ->all();
return $this->viewResponse('modules/faq/show', [
'faqs' => $faqs,
@@ -387,7 +388,14 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleCon
/**
* @param Tree $tree
*
- * @return Collection<int,object>
+ * @return Collection<int,object{
+ * block_id: int,
+ * block_order: int,
+ * gedcom_id: int,
+ * header: string,
+ * faqbody: string,
+ * languages: string
+ * }>
*/
private function faqsForTree(Tree $tree): Collection
{
diff --git a/app/Module/LifespansChartModule.php b/app/Module/LifespansChartModule.php
index c97ea25b89..ef7f1021e6 100644
--- a/app/Module/LifespansChartModule.php
+++ b/app/Module/LifespansChartModule.php
@@ -408,7 +408,14 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac
/**
* @param array<Individual> $individuals
*
- * @return array<object>
+ * @return array<object{
+ * background: string,
+ * birth_year: int,
+ * death_year: int,
+ * id: string,
+ * individual: Individual,
+ * row: int
+ * }>
*/
private function layoutIndividuals(array $individuals): array
{
diff --git a/app/Module/RelativesTabModule.php b/app/Module/RelativesTabModule.php
index 0a6cd77455..d1aec1e0f2 100644
--- a/app/Module/RelativesTabModule.php
+++ b/app/Module/RelativesTabModule.php
@@ -22,6 +22,8 @@ namespace Fisharebest\Webtrees\Module;
use Fisharebest\Webtrees\Auth;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
+use Fisharebest\Webtrees\Registry;
+use Fisharebest\Webtrees\Services\RelationshipService;
use Illuminate\Support\Collection;
class RelativesTabModule extends AbstractModule implements ModuleTabInterface
@@ -71,6 +73,7 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface
'can_edit' => $individual->canEdit(),
'individual' => $individual,
'parent_families' => $individual->childFamilies(),
+ 'relationship_service' => Registry::container()->get(RelationshipService::class),
'spouse_families' => $individual->spouseFamilies(),
'step_child_families' => $individual->spouseStepFamilies(),
'step_parent_families' => $individual->childStepFamilies(),
diff --git a/app/Module/StoriesModule.php b/app/Module/StoriesModule.php
index 314b6fd146..490db0a28c 100644
--- a/app/Module/StoriesModule.php
+++ b/app/Module/StoriesModule.php
@@ -104,9 +104,7 @@ class StoriesModule extends AbstractModule implements ModuleConfigInterface, Mod
}
/**
- * @param Individual $individual
- *
- * @return array<object>
+ * @return array<object{block_id:int,title:string,story_body:string}>
*/
private function getStoriesForIndividual(Individual $individual): array
{
diff --git a/app/Module/TopSurnamesModule.php b/app/Module/TopSurnamesModule.php
index a7ece3ed61..d218a65d9f 100644
--- a/app/Module/TopSurnamesModule.php
+++ b/app/Module/TopSurnamesModule.php
@@ -102,7 +102,7 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface
DB::binaryColumn('n_surname'),
]);
- /** @var array<array<int>> $top_surnames */
+ /** @var array<non-empty-array<int>> $top_surnames */
$top_surnames = [];
foreach ($query->get() as $row) {
diff --git a/app/Module/UserFavoritesModule.php b/app/Module/UserFavoritesModule.php
index c61af2919f..c2a102c738 100644
--- a/app/Module/UserFavoritesModule.php
+++ b/app/Module/UserFavoritesModule.php
@@ -118,13 +118,21 @@ class UserFavoritesModule extends AbstractModule implements ModuleBlockInterface
* @param Tree $tree
* @param UserInterface $user
*
- * @return array<object>
+ * @return array<int,object{
+ * favorite_id:string,
+ * favorite_type:string,
+ * url:string|null,
+ * note:string|null,
+ * title:string|null,
+ * record:GedcomRecord|null
+ * }>
*/
public function getFavorites(Tree $tree, UserInterface $user): array
{
return DB::table('favorite')
->where('gedcom_id', '=', $tree->id())
->where('user_id', '=', $user->id())
+ ->select(['favorite_id', 'xref', 'favorite_type', 'url', 'title', 'note'])
->get()
->map(static function (object $row) use ($tree): object {
if ($row->xref !== null) {
diff --git a/app/Services/PendingChangesService.php b/app/Services/PendingChangesService.php
index bd2d080a76..676b45574a 100644
--- a/app/Services/PendingChangesService.php
+++ b/app/Services/PendingChangesService.php
@@ -23,6 +23,7 @@ use DateInterval;
use DateTimeImmutable;
use DateTimeZone;
use Fisharebest\Webtrees\Auth;
+use Fisharebest\Webtrees\Contracts\TimestampInterface;
use Fisharebest\Webtrees\Contracts\UserInterface;
use Fisharebest\Webtrees\DB;
use Fisharebest\Webtrees\Exceptions\GedcomErrorException;
@@ -80,10 +81,16 @@ class PendingChangesService
}
/**
- * @param Tree $tree
- * @param int $n
- *
- * @return array<array<object>>
+ * @return array<array<object{
+ * xref:string,
+ * change_id:string,
+ * old_gedcom:string|null,
+ * new_gedcom:string|null,
+ * change_time:TimestampInterface,
+ * record:GedcomRecord,
+ * user_name:string,
+ * real_name:string
+ * }>>
*/
public function pendingChanges(Tree $tree, int $n): array
{
diff --git a/app/StatisticsData.php b/app/StatisticsData.php
index 6b62a4a68d..6fcabdb358 100644
--- a/app/StatisticsData.php
+++ b/app/StatisticsData.php
@@ -1422,7 +1422,7 @@ readonly class StatisticsData
}
/**
- * @return array<array<string,int|Family>>
+ * @return array<array{family:Family,count:int}>
*/
private function topTenGrandFamilyQuery(int $limit): array
{
@@ -1612,7 +1612,7 @@ readonly class StatisticsData
}
/**
- * @return array<array<string,mixed>>
+ * @return array<array{family:Family,count:int}>
*/
private function topTenFamilyQuery(int $limit): array
{