summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2020-05-24 10:24:44 +0100
committerGreg Roach <greg@subaqua.co.uk>2020-05-24 10:24:44 +0100
commit9123453f21f45266d13547cab861032c3c4f912b (patch)
tree2789d906caa884879200accd37f9af2ef2e6c867 /app
parente3dbde6fc70f4dd05f8a60399f0625da7764a16d (diff)
downloadwebtrees-9123453f21f45266d13547cab861032c3c4f912b.tar.gz
webtrees-9123453f21f45266d13547cab861032c3c4f912b.tar.bz2
webtrees-9123453f21f45266d13547cab861032c3c4f912b.zip
PHPdoc
Diffstat (limited to 'app')
-rw-r--r--app/Application.php4
-rw-r--r--app/DebugBar/ViewCollector.php8
-rw-r--r--app/Statistics/Repository/EventRepository.php13
-rw-r--r--app/Statistics/Repository/FamilyDatesRepository.php5
-rw-r--r--app/Statistics/Repository/FamilyRepository.php9
5 files changed, 21 insertions, 18 deletions
diff --git a/app/Application.php b/app/Application.php
index 4a1aaaadba..42dac0d392 100644
--- a/app/Application.php
+++ b/app/Application.php
@@ -49,9 +49,9 @@ class Application extends Container
}
/**
- * @param array $parameters
+ * @param array<ReflectionParameter> $parameters
*
- * @return mixed[]
+ * @return array<mixed>
*/
private function makeParameters(array $parameters): array
{
diff --git a/app/DebugBar/ViewCollector.php b/app/DebugBar/ViewCollector.php
index b4c269f1eb..c34ec8a3b6 100644
--- a/app/DebugBar/ViewCollector.php
+++ b/app/DebugBar/ViewCollector.php
@@ -34,8 +34,8 @@ class ViewCollector extends DataCollector implements Renderable
/**
* Add details about a view
*
- * @param string $view
- * @param array $data
+ * @param string $view
+ * @param array<string,mixed> $data
*
* @return void
*/
@@ -50,7 +50,7 @@ class ViewCollector extends DataCollector implements Renderable
/**
* Called by the DebugBar when data needs to be collected
*
- * @return array Collected data
+ * @return array<string,mixed> Collected data
*/
public function collect(): array
{
@@ -76,7 +76,7 @@ class ViewCollector extends DataCollector implements Renderable
* Returns a hash where keys are control names and their values
* an array of options as defined in {@see \DebugBar\JavascriptRenderer::addControl()}
*
- * @return array
+ * @return array<string,mixed>
*/
public function getWidgets(): array
{
diff --git a/app/Statistics/Repository/EventRepository.php b/app/Statistics/Repository/EventRepository.php
index 128e4e2517..230d8697fc 100644
--- a/app/Statistics/Repository/EventRepository.php
+++ b/app/Statistics/Repository/EventRepository.php
@@ -32,6 +32,7 @@ use Fisharebest\Webtrees\Tree;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\Builder;
+use stdClass;
/**
* A repository providing methods for event related statistics.
@@ -73,7 +74,7 @@ class EventRepository implements EventRepositoryInterface
/**
* Returns the total number of a given list of events (with dates).
*
- * @param array $events The list of events to count (e.g. BIRT, DEAT, ...)
+ * @param array<string> $events The list of events to count (e.g. BIRT, DEAT, ...)
*
* @return int
*/
@@ -87,7 +88,7 @@ class EventRepository implements EventRepositoryInterface
'CHAN',
];
- if ($events) {
+ if ($events !== []) {
$types = [];
foreach ($events as $type) {
@@ -98,7 +99,7 @@ class EventRepository implements EventRepositoryInterface
}
}
- if ($types) {
+ if ($types !== []) {
$query->whereIn('d_fact', $types);
}
}
@@ -186,7 +187,7 @@ class EventRepository implements EventRepositoryInterface
/**
* Retursn the list of common facts used query the data.
*
- * @return array
+ * @return array<string>
*/
private function getCommonFacts(): array
{
@@ -219,9 +220,9 @@ class EventRepository implements EventRepositoryInterface
*
* @param string $direction The sorting direction of the query (To return first or last record)
*
- * @return Model|Builder|object|null
+ * @return stdClass|null
*/
- private function eventQuery(string $direction)
+ private function eventQuery(string $direction): ?stdClass
{
return DB::table('dates')
->select(['d_gid as id', 'd_year as year', 'd_fact AS fact', 'd_type AS type'])
diff --git a/app/Statistics/Repository/FamilyDatesRepository.php b/app/Statistics/Repository/FamilyDatesRepository.php
index f2324d0263..c22f5c02fd 100644
--- a/app/Statistics/Repository/FamilyDatesRepository.php
+++ b/app/Statistics/Repository/FamilyDatesRepository.php
@@ -29,6 +29,7 @@ use Fisharebest\Webtrees\Tree;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\Builder;
+use stdClass;
/**
* A repository providing methods for family dates related statistics (birth, death, marriage, divorce).
@@ -70,9 +71,9 @@ class FamilyDatesRepository implements FamilyDatesRepositoryInterface
* @param string $fact
* @param string $operation
*
- * @return Model|object|static|null
+ * @return stdClass|null
*/
- private function eventQuery(string $fact, string $operation)
+ private function eventQuery(string $fact, string $operation): ?stdClass
{
return DB::table('dates')
->select(['d_gid as id', 'd_year as year', 'd_fact AS fact', 'd_type AS type'])
diff --git a/app/Statistics/Repository/FamilyRepository.php b/app/Statistics/Repository/FamilyRepository.php
index ca01d7be6d..bedced9838 100644
--- a/app/Statistics/Repository/FamilyRepository.php
+++ b/app/Statistics/Repository/FamilyRepository.php
@@ -24,6 +24,7 @@ use Fisharebest\Webtrees\Factory;
use Fisharebest\Webtrees\Family;
use Fisharebest\Webtrees\GedcomRecord;
use Fisharebest\Webtrees\I18N;
+use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Statistics\Google\ChartChildren;
use Fisharebest\Webtrees\Statistics\Google\ChartDivorce;
use Fisharebest\Webtrees\Statistics\Google\ChartFamilyLargest;
@@ -132,7 +133,7 @@ class FamilyRepository
*
* @param int $total
*
- * @return array
+ * @return array<stdClass>
*/
private function topTenGrandFamilyQuery(int $total): array
{
@@ -290,7 +291,7 @@ class FamilyRepository
*
* @param int $total The total number of records to query
*
- * @return array
+ * @return array<stdClass>
*/
private function ageBetweenSiblingsQuery(int $total): array
{
@@ -356,7 +357,7 @@ class FamilyRepository
*
* @param int $total The total number of records to query
*
- * @return array
+ * @return array<mixed>
* @throws Exception
*/
private function ageBetweenSiblingsNoList(int $total): array
@@ -388,7 +389,7 @@ class FamilyRepository
* @param int $total The total number of records to query
* @param bool $one Include each family only once if true
*
- * @return array
+ * @return array<string,array>
* @throws Exception
*/
private function ageBetweenSiblingsList(int $total, bool $one): array