diff options
336 files changed, 1445 insertions, 1442 deletions
diff --git a/app/Auth.php b/app/Auth.php index 1523e604cd..f17831dbf4 100644 --- a/app/Auth.php +++ b/app/Auth.php @@ -33,7 +33,7 @@ class Auth * * @return bool */ - public static function check() + public static function check(): bool { return self::id() !== null; } @@ -45,7 +45,7 @@ class Auth * * @return bool */ - public static function isAdmin(User $user = null) + public static function isAdmin(User $user = null): bool { if ($user === null) { $user = self::user(); @@ -62,7 +62,7 @@ class Auth * * @return bool */ - public static function isManager(Tree $tree, User $user = null) + public static function isManager(Tree $tree, User $user = null): bool { if ($user === null) { $user = self::user(); @@ -79,7 +79,7 @@ class Auth * * @return bool */ - public static function isModerator(Tree $tree, User $user = null) + public static function isModerator(Tree $tree, User $user = null): bool { if ($user === null) { $user = self::user(); @@ -96,7 +96,7 @@ class Auth * * @return bool */ - public static function isEditor(Tree $tree, User $user = null) + public static function isEditor(Tree $tree, User $user = null): bool { if ($user === null) { $user = self::user(); @@ -113,7 +113,7 @@ class Auth * * @return bool */ - public static function isMember(Tree $tree, User $user = null) + public static function isMember(Tree $tree, User $user = null): bool { if ($user === null) { $user = self::user(); diff --git a/app/Bootstrap4.php b/app/Bootstrap4.php index 7d4d04dad0..6f89487b02 100644 --- a/app/Bootstrap4.php +++ b/app/Bootstrap4.php @@ -47,7 +47,7 @@ class Bootstrap4 extends Html * * @return string */ - public static function checkbox($label, $inline, $attributes = []) + public static function checkbox($label, $inline, $attributes = []): string { if ($inline) { $class = 'form-check form-check-inline'; @@ -80,7 +80,7 @@ class Bootstrap4 extends Html * * @return string */ - public static function radioButtons($name, $values, $selected, $inline, $attributes = []) + public static function radioButtons($name, $values, $selected, $inline, $attributes = []): string { // An empty string is not the same as zero (but is the same as NULL). if ($selected === null) { @@ -123,7 +123,7 @@ class Bootstrap4 extends Html * * @return string */ - public static function select($options, $selected, $attributes = []) + public static function select($options, $selected, $attributes = []): string { $html = ''; foreach ($options as $value => $option) { @@ -155,7 +155,7 @@ class Bootstrap4 extends Html * * @return string */ - public static function multiSelect($options, $selected, $attributes = []) + public static function multiSelect($options, $selected, $attributes = []): string { $html = ''; foreach ($options as $value => $option) { diff --git a/app/Census/AbstractCensusColumn.php b/app/Census/AbstractCensusColumn.php index 641f0cc0d6..61af235270 100644 --- a/app/Census/AbstractCensusColumn.php +++ b/app/Census/AbstractCensusColumn.php @@ -53,7 +53,7 @@ class AbstractCensusColumn * * @return string */ - public function abbreviation() + public function abbreviation(): string { return $this->abbr; } @@ -127,7 +127,7 @@ class AbstractCensusColumn * * @return Date */ - public function date() + public function date(): Date { return new Date($this->census->censusDate()); } @@ -137,7 +137,7 @@ class AbstractCensusColumn * * @return string */ - public function title() + public function title(): string { return $this->title; } @@ -149,7 +149,7 @@ class AbstractCensusColumn * * @return string - e.g. "England" */ - protected function lastPartOfPlace($place) + protected function lastPartOfPlace($place): string { $place = explode(', ', $place); @@ -179,7 +179,7 @@ class AbstractCensusColumn * * @return string */ - public function place() + public function place(): string { return $this->census->censusPlace(); } diff --git a/app/Census/AbstractCensusColumnCondition.php b/app/Census/AbstractCensusColumnCondition.php index 289f923917..a3d72980ce 100644 --- a/app/Census/AbstractCensusColumnCondition.php +++ b/app/Census/AbstractCensusColumnCondition.php @@ -95,7 +95,7 @@ abstract class AbstractCensusColumnCondition extends AbstractCensusColumn implem * * @return bool */ - private function isChild(Individual $individual) + private function isChild(Individual $individual): bool { $age = (int)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); @@ -157,7 +157,7 @@ abstract class AbstractCensusColumnCondition extends AbstractCensusColumn implem * * @return bool */ - private function isDead(Individual $individual) + private function isDead(Individual $individual): bool { return $individual->getDeathDate()->isOK() && Date::compare($individual->getDeathDate(), $this->date()) < 0; } diff --git a/app/Census/Census.php b/app/Census/Census.php index 8876709b97..87901b8a0f 100644 --- a/app/Census/Census.php +++ b/app/Census/Census.php @@ -26,7 +26,7 @@ class Census * * @return CensusPlaceInterface[] */ - public static function censusPlaces(string $locale) + public static function censusPlaces(string $locale): array { $all_census_places = [ new CensusOfCzechRepublic(), diff --git a/app/Census/CensusColumnAge.php b/app/Census/CensusColumnAge.php index 68d5378757..903580f701 100644 --- a/app/Census/CensusColumnAge.php +++ b/app/Census/CensusColumnAge.php @@ -32,7 +32,7 @@ class CensusColumnAge extends AbstractCensusColumn implements CensusColumnInterf * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); } diff --git a/app/Census/CensusColumnAgeMarried.php b/app/Census/CensusColumnAgeMarried.php index 6423b9aa9e..888e857f08 100644 --- a/app/Census/CensusColumnAgeMarried.php +++ b/app/Census/CensusColumnAgeMarried.php @@ -32,7 +32,7 @@ class CensusColumnAgeMarried extends AbstractCensusColumn implements CensusColum * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { if ($individual->getBirthDate()->isOK()) { foreach ($individual->getSpouseFamilies() as $family) { diff --git a/app/Census/CensusColumnBirthDate.php b/app/Census/CensusColumnBirthDate.php index aa89a535ce..dc20a2f6c2 100644 --- a/app/Census/CensusColumnBirthDate.php +++ b/app/Census/CensusColumnBirthDate.php @@ -31,7 +31,7 @@ class CensusColumnBirthDate extends AbstractCensusColumn implements CensusColumn * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return $individual->getEstimatedBirthDate()->minimumDate()->format('%j %n %Y'); } diff --git a/app/Census/CensusColumnBirthDay.php b/app/Census/CensusColumnBirthDay.php index 47c9eaf6a6..09621f13e5 100644 --- a/app/Census/CensusColumnBirthDay.php +++ b/app/Census/CensusColumnBirthDay.php @@ -31,7 +31,7 @@ class CensusColumnBirthDay extends AbstractCensusColumn implements CensusColumnI * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return $individual->getEstimatedBirthDate()->minimumDate()->format('%j'); } diff --git a/app/Census/CensusColumnBirthMonth.php b/app/Census/CensusColumnBirthMonth.php index e8a912e85a..02bac9d300 100644 --- a/app/Census/CensusColumnBirthMonth.php +++ b/app/Census/CensusColumnBirthMonth.php @@ -31,7 +31,7 @@ class CensusColumnBirthMonth extends AbstractCensusColumn implements CensusColum * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return $individual->getEstimatedBirthDate()->minimumDate()->format('%M'); } diff --git a/app/Census/CensusColumnBirthPlaceSimple.php b/app/Census/CensusColumnBirthPlaceSimple.php index c020806563..05ba91e4f7 100644 --- a/app/Census/CensusColumnBirthPlaceSimple.php +++ b/app/Census/CensusColumnBirthPlaceSimple.php @@ -31,7 +31,7 @@ class CensusColumnBirthPlaceSimple extends CensusColumnBirthPlace implements Cen * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return $this->lastPartOfPlace(parent::generate($individual, $head)); } diff --git a/app/Census/CensusColumnBirthYear.php b/app/Census/CensusColumnBirthYear.php index 564beba8b0..d37663128c 100644 --- a/app/Census/CensusColumnBirthYear.php +++ b/app/Census/CensusColumnBirthYear.php @@ -31,7 +31,7 @@ class CensusColumnBirthYear extends AbstractCensusColumn implements CensusColumn * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return $individual->getEstimatedBirthDate()->minimumDate()->format('%Y'); } diff --git a/app/Census/CensusColumnChildrenBornAlive.php b/app/Census/CensusColumnChildrenBornAlive.php index e726cca04a..3a1deef4eb 100644 --- a/app/Census/CensusColumnChildrenBornAlive.php +++ b/app/Census/CensusColumnChildrenBornAlive.php @@ -32,7 +32,7 @@ class CensusColumnChildrenBornAlive extends AbstractCensusColumn implements Cens * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { if ($individual->getSex() !== 'F') { return ''; diff --git a/app/Census/CensusColumnChildrenDied.php b/app/Census/CensusColumnChildrenDied.php index cd3fa2707c..060ca8343b 100644 --- a/app/Census/CensusColumnChildrenDied.php +++ b/app/Census/CensusColumnChildrenDied.php @@ -32,7 +32,7 @@ class CensusColumnChildrenDied extends AbstractCensusColumn implements CensusCol * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { if ($individual->getSex() !== 'F') { return ''; diff --git a/app/Census/CensusColumnChildrenLiving.php b/app/Census/CensusColumnChildrenLiving.php index c07952e3de..5d2da7b88f 100644 --- a/app/Census/CensusColumnChildrenLiving.php +++ b/app/Census/CensusColumnChildrenLiving.php @@ -32,7 +32,7 @@ class CensusColumnChildrenLiving extends AbstractCensusColumn implements CensusC * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { if ($individual->getSex() !== 'F') { return ''; diff --git a/app/Census/CensusColumnFatherBirthPlaceSimple.php b/app/Census/CensusColumnFatherBirthPlaceSimple.php index 865f9129ca..6735b81246 100644 --- a/app/Census/CensusColumnFatherBirthPlaceSimple.php +++ b/app/Census/CensusColumnFatherBirthPlaceSimple.php @@ -31,7 +31,7 @@ class CensusColumnFatherBirthPlaceSimple extends CensusColumnFatherBirthPlace im * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return $this->lastPartOfPlace(parent::generate($individual, $head)); } diff --git a/app/Census/CensusColumnFullName.php b/app/Census/CensusColumnFullName.php index eeef050987..1066483fcd 100644 --- a/app/Census/CensusColumnFullName.php +++ b/app/Census/CensusColumnFullName.php @@ -32,7 +32,7 @@ class CensusColumnFullName extends AbstractCensusColumn implements CensusColumnI * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { $name = $this->nameAtCensusDate($individual, $this->date()); @@ -48,7 +48,7 @@ class CensusColumnFullName extends AbstractCensusColumn implements CensusColumnI * * @return string[] */ - protected function nameAtCensusDate(Individual $individual, Date $census_date) + protected function nameAtCensusDate(Individual $individual, Date $census_date): array { $names = $individual->getAllNames(); $name = $names[0]; diff --git a/app/Census/CensusColumnGivenNameInitial.php b/app/Census/CensusColumnGivenNameInitial.php index be0bb454c1..510888fbeb 100644 --- a/app/Census/CensusColumnGivenNameInitial.php +++ b/app/Census/CensusColumnGivenNameInitial.php @@ -31,7 +31,7 @@ class CensusColumnGivenNameInitial extends AbstractCensusColumn implements Censu * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { foreach ($individual->getAllNames() as $name) { $given = $name['givn']; diff --git a/app/Census/CensusColumnGivenNames.php b/app/Census/CensusColumnGivenNames.php index 2434c61619..bb62fb3eed 100644 --- a/app/Census/CensusColumnGivenNames.php +++ b/app/Census/CensusColumnGivenNames.php @@ -31,7 +31,7 @@ class CensusColumnGivenNames extends AbstractCensusColumn implements CensusColum * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { foreach ($individual->getAllNames() as $name) { return $name['givn']; diff --git a/app/Census/CensusColumnInterface.php b/app/Census/CensusColumnInterface.php index 34a93a4a9e..8fcb1775fa 100644 --- a/app/Census/CensusColumnInterface.php +++ b/app/Census/CensusColumnInterface.php @@ -29,14 +29,14 @@ interface CensusColumnInterface * * @return string */ - public function abbreviation(); + public function abbreviation(): string; /** * When did this census occur * * @return Date */ - public function date(); + public function date(): Date; /** * Generate the likely value of this census column, based on available information. @@ -46,19 +46,19 @@ interface CensusColumnInterface * * @return string */ - public function generate(Individual $individual, Individual $head); + public function generate(Individual $individual, Individual $head): string; /** * Where did this census occur * * @return string */ - public function place(); + public function place(): string; /** * The full version of the column's name. * * @return string */ - public function title(); + public function title(): string; } diff --git a/app/Census/CensusColumnMarriedWithinYear.php b/app/Census/CensusColumnMarriedWithinYear.php index a49c562cb9..0a58893ddd 100644 --- a/app/Census/CensusColumnMarriedWithinYear.php +++ b/app/Census/CensusColumnMarriedWithinYear.php @@ -31,7 +31,7 @@ class CensusColumnMarriedWithinYear extends AbstractCensusColumn implements Cens * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { foreach ($individual->getSpouseFamilies() as $family) { foreach ($family->getFacts('MARR') as $fact) { diff --git a/app/Census/CensusColumnMonthIfMarriedWithinYear.php b/app/Census/CensusColumnMonthIfMarriedWithinYear.php index 0ab422a591..2bcc5ec9de 100644 --- a/app/Census/CensusColumnMonthIfMarriedWithinYear.php +++ b/app/Census/CensusColumnMonthIfMarriedWithinYear.php @@ -31,7 +31,7 @@ class CensusColumnMonthIfMarriedWithinYear extends AbstractCensusColumn implemen * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { foreach ($individual->getSpouseFamilies() as $family) { foreach ($family->getFacts('MARR') as $fact) { diff --git a/app/Census/CensusColumnMotherBirthPlaceSimple.php b/app/Census/CensusColumnMotherBirthPlaceSimple.php index bed239a092..57da9dd46d 100644 --- a/app/Census/CensusColumnMotherBirthPlaceSimple.php +++ b/app/Census/CensusColumnMotherBirthPlaceSimple.php @@ -31,7 +31,7 @@ class CensusColumnMotherBirthPlaceSimple extends CensusColumnMotherBirthPlace im * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return $this->lastPartOfPlace(parent::generate($individual, $head)); } diff --git a/app/Census/CensusColumnNull.php b/app/Census/CensusColumnNull.php index 5370c3848f..0480120c73 100644 --- a/app/Census/CensusColumnNull.php +++ b/app/Census/CensusColumnNull.php @@ -31,7 +31,7 @@ class CensusColumnNull extends AbstractCensusColumn implements CensusColumnInter * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return ''; } diff --git a/app/Census/CensusColumnOccupation.php b/app/Census/CensusColumnOccupation.php index bd821ca3d8..0020a70ea5 100644 --- a/app/Census/CensusColumnOccupation.php +++ b/app/Census/CensusColumnOccupation.php @@ -31,7 +31,7 @@ class CensusColumnOccupation extends AbstractCensusColumn implements CensusColum * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { foreach ($individual->getFacts('OCCU') as $fact) { return $fact->getValue(); diff --git a/app/Census/CensusColumnReligion.php b/app/Census/CensusColumnReligion.php index a8a0e273f4..e54f4f2d9f 100644 --- a/app/Census/CensusColumnReligion.php +++ b/app/Census/CensusColumnReligion.php @@ -33,7 +33,7 @@ class CensusColumnReligion extends AbstractCensusColumn implements CensusColumnI * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { return ''; } diff --git a/app/Census/CensusColumnSurname.php b/app/Census/CensusColumnSurname.php index 73c60dfdfe..76ceb0a75a 100644 --- a/app/Census/CensusColumnSurname.php +++ b/app/Census/CensusColumnSurname.php @@ -31,7 +31,7 @@ class CensusColumnSurname extends AbstractCensusColumn implements CensusColumnIn * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { foreach ($individual->getAllNames() as $name) { return $name['surname']; diff --git a/app/Census/CensusColumnSurnameGivenNames.php b/app/Census/CensusColumnSurnameGivenNames.php index 626ba180a9..5de0a3b469 100644 --- a/app/Census/CensusColumnSurnameGivenNames.php +++ b/app/Census/CensusColumnSurnameGivenNames.php @@ -31,7 +31,7 @@ class CensusColumnSurnameGivenNames extends AbstractCensusColumn implements Cens * * @return string */ - public function generate(Individual $individual, Individual $head) + public function generate(Individual $individual, Individual $head): string { foreach ($individual->getAllNames() as $name) { return $name['surname'] . ', ' . $name['givn']; diff --git a/app/Census/CensusInterface.php b/app/Census/CensusInterface.php index 61f02645fc..abd729c784 100644 --- a/app/Census/CensusInterface.php +++ b/app/Census/CensusInterface.php @@ -26,12 +26,12 @@ interface CensusInterface extends CensusPlaceInterface * * @return string */ - public function censusDate(); + public function censusDate(): string; /** * The columns of the census. * * @return CensusColumnInterface[] */ - public function columns(); + public function columns(): array; } diff --git a/app/Census/CensusOfCzechRepublic.php b/app/Census/CensusOfCzechRepublic.php index d0f108b237..b7bd967679 100644 --- a/app/Census/CensusOfCzechRepublic.php +++ b/app/Census/CensusOfCzechRepublic.php @@ -26,7 +26,7 @@ class CensusOfCzechRepublic extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfCzechRepublic1880(), @@ -42,7 +42,7 @@ class CensusOfCzechRepublic extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Česko'; } diff --git a/app/Census/CensusOfCzechRepublic1880.php b/app/Census/CensusOfCzechRepublic1880.php index a735de3937..ebc9a5ec93 100644 --- a/app/Census/CensusOfCzechRepublic1880.php +++ b/app/Census/CensusOfCzechRepublic1880.php @@ -26,7 +26,7 @@ class CensusOfCzechRepublic1880 extends CensusOfCzechRepublic implements CensusI * * @return string */ - public function censusDate() + public function censusDate(): string { return '31 DEC 1880'; } @@ -36,7 +36,7 @@ class CensusOfCzechRepublic1880 extends CensusOfCzechRepublic implements CensusI * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Jméno', ''), diff --git a/app/Census/CensusOfCzechRepublic1890.php b/app/Census/CensusOfCzechRepublic1890.php index 1719270657..948b629def 100644 --- a/app/Census/CensusOfCzechRepublic1890.php +++ b/app/Census/CensusOfCzechRepublic1890.php @@ -25,7 +25,7 @@ class CensusOfCzechRepublic1890 extends CensusOfCzechRepublic implements CensusI * * @return string */ - public function censusDate() + public function censusDate(): string { return '31 DEC 1890'; } @@ -35,7 +35,7 @@ class CensusOfCzechRepublic1890 extends CensusOfCzechRepublic implements CensusI * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Jméno', ''), diff --git a/app/Census/CensusOfCzechRepublic1900.php b/app/Census/CensusOfCzechRepublic1900.php index 0023a52d9c..d64fc9f0cb 100644 --- a/app/Census/CensusOfCzechRepublic1900.php +++ b/app/Census/CensusOfCzechRepublic1900.php @@ -25,7 +25,7 @@ class CensusOfCzechRepublic1900 extends CensusOfCzechRepublic implements CensusI * * @return string */ - public function censusDate() + public function censusDate(): string { return '31 DEC 1900'; } @@ -35,7 +35,7 @@ class CensusOfCzechRepublic1900 extends CensusOfCzechRepublic implements CensusI * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Jméno', ''), diff --git a/app/Census/CensusOfCzechRepublic1910.php b/app/Census/CensusOfCzechRepublic1910.php index 76743f3e7c..f509cefd31 100644 --- a/app/Census/CensusOfCzechRepublic1910.php +++ b/app/Census/CensusOfCzechRepublic1910.php @@ -25,7 +25,7 @@ class CensusOfCzechRepublic1910 extends CensusOfCzechRepublic implements CensusI * * @return string */ - public function censusDate() + public function censusDate(): string { return '31 DEC 1910'; } @@ -35,7 +35,7 @@ class CensusOfCzechRepublic1910 extends CensusOfCzechRepublic implements CensusI * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Jméno', ''), diff --git a/app/Census/CensusOfCzechRepublic1921.php b/app/Census/CensusOfCzechRepublic1921.php index 1dd749dd91..195427e6ea 100644 --- a/app/Census/CensusOfCzechRepublic1921.php +++ b/app/Census/CensusOfCzechRepublic1921.php @@ -26,7 +26,7 @@ class CensusOfCzechRepublic1921 extends CensusOfCzechRepublic implements CensusI * * @return string */ - public function censusDate() + public function censusDate(): string { return '15 FEB 1921'; } @@ -36,7 +36,7 @@ class CensusOfCzechRepublic1921 extends CensusOfCzechRepublic implements CensusI * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Jméno', ''), diff --git a/app/Census/CensusOfDenmark.php b/app/Census/CensusOfDenmark.php index ea27ecc0c9..6a7c04d216 100644 --- a/app/Census/CensusOfDenmark.php +++ b/app/Census/CensusOfDenmark.php @@ -26,7 +26,7 @@ class CensusOfDenmark extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfDenmark1787(), @@ -59,7 +59,7 @@ class CensusOfDenmark extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Danmark'; } diff --git a/app/Census/CensusOfDenmark1787.php b/app/Census/CensusOfDenmark1787.php index 0d60a7cad3..3837714ce0 100644 --- a/app/Census/CensusOfDenmark1787.php +++ b/app/Census/CensusOfDenmark1787.php @@ -26,7 +26,7 @@ class CensusOfDenmark1787 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 JUL 1787'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1787 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1801.php b/app/Census/CensusOfDenmark1801.php index 153e9d22a3..f74937a932 100644 --- a/app/Census/CensusOfDenmark1801.php +++ b/app/Census/CensusOfDenmark1801.php @@ -26,7 +26,7 @@ class CensusOfDenmark1801 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1801'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1801 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1803.php b/app/Census/CensusOfDenmark1803.php index 54f161ceb3..0ac1b755e3 100644 --- a/app/Census/CensusOfDenmark1803.php +++ b/app/Census/CensusOfDenmark1803.php @@ -26,7 +26,7 @@ class CensusOfDenmark1803 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1803'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1803 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Schleswig-Holstein, Deutschland'; } @@ -46,7 +46,7 @@ class CensusOfDenmark1803 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1834.php b/app/Census/CensusOfDenmark1834.php index d6b4de181f..c155172573 100644 --- a/app/Census/CensusOfDenmark1834.php +++ b/app/Census/CensusOfDenmark1834.php @@ -26,7 +26,7 @@ class CensusOfDenmark1834 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '18 FEB 1834'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1834 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1835.php b/app/Census/CensusOfDenmark1835.php index 1d7dcd25a5..f78a737c0f 100644 --- a/app/Census/CensusOfDenmark1835.php +++ b/app/Census/CensusOfDenmark1835.php @@ -26,7 +26,7 @@ class CensusOfDenmark1835 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '18 FEB 1835'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1835 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Schleswig-Holstein, Deutschland'; } @@ -46,7 +46,7 @@ class CensusOfDenmark1835 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1840.php b/app/Census/CensusOfDenmark1840.php index 250caa60e8..f0f58319e7 100644 --- a/app/Census/CensusOfDenmark1840.php +++ b/app/Census/CensusOfDenmark1840.php @@ -26,7 +26,7 @@ class CensusOfDenmark1840 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1840'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1840 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1845.php b/app/Census/CensusOfDenmark1845.php index 1c4364e9a6..9bc7f05904 100644 --- a/app/Census/CensusOfDenmark1845.php +++ b/app/Census/CensusOfDenmark1845.php @@ -26,7 +26,7 @@ class CensusOfDenmark1845 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1845'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1845 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1850.php b/app/Census/CensusOfDenmark1850.php index a9d345b705..03d0d48457 100644 --- a/app/Census/CensusOfDenmark1850.php +++ b/app/Census/CensusOfDenmark1850.php @@ -26,7 +26,7 @@ class CensusOfDenmark1850 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1850'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1850 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1855.php b/app/Census/CensusOfDenmark1855.php index 9449b790f4..f506df2ec7 100644 --- a/app/Census/CensusOfDenmark1855.php +++ b/app/Census/CensusOfDenmark1855.php @@ -26,7 +26,7 @@ class CensusOfDenmark1855 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1855'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1855 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1860.php b/app/Census/CensusOfDenmark1860.php index 7ebd8e73bc..000c69acb8 100644 --- a/app/Census/CensusOfDenmark1860.php +++ b/app/Census/CensusOfDenmark1860.php @@ -26,7 +26,7 @@ class CensusOfDenmark1860 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1860'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1860 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1870.php b/app/Census/CensusOfDenmark1870.php index 618668b7b3..0f5e397ce5 100644 --- a/app/Census/CensusOfDenmark1870.php +++ b/app/Census/CensusOfDenmark1870.php @@ -26,7 +26,7 @@ class CensusOfDenmark1870 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1870'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1870 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1880.php b/app/Census/CensusOfDenmark1880.php index 37d48bff81..d00d1ef140 100644 --- a/app/Census/CensusOfDenmark1880.php +++ b/app/Census/CensusOfDenmark1880.php @@ -26,7 +26,7 @@ class CensusOfDenmark1880 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1880'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1880 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1885.php b/app/Census/CensusOfDenmark1885.php index a9b7ac51e4..2631db5e66 100644 --- a/app/Census/CensusOfDenmark1885.php +++ b/app/Census/CensusOfDenmark1885.php @@ -26,7 +26,7 @@ class CensusOfDenmark1885 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1885'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1885 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'København, Danmark'; } @@ -46,7 +46,7 @@ class CensusOfDenmark1885 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1890.php b/app/Census/CensusOfDenmark1890.php index 5c392cd415..01f89c33ca 100644 --- a/app/Census/CensusOfDenmark1890.php +++ b/app/Census/CensusOfDenmark1890.php @@ -26,7 +26,7 @@ class CensusOfDenmark1890 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1890'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1890 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', 'Samtlige Personers fulde Navn.'), diff --git a/app/Census/CensusOfDenmark1901.php b/app/Census/CensusOfDenmark1901.php index 0b32106f4f..1b62c05bc0 100644 --- a/app/Census/CensusOfDenmark1901.php +++ b/app/Census/CensusOfDenmark1901.php @@ -26,7 +26,7 @@ class CensusOfDenmark1901 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1901'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1901 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', 'Samtlige Personers Navn (ogsaa Fornavn). Ved Børn, endnu uden Navn, sættes „Dreng“ eller „Pige“.'), diff --git a/app/Census/CensusOfDenmark1906.php b/app/Census/CensusOfDenmark1906.php index 498a9edc5a..d7019fc1ae 100644 --- a/app/Census/CensusOfDenmark1906.php +++ b/app/Census/CensusOfDenmark1906.php @@ -26,7 +26,7 @@ class CensusOfDenmark1906 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1906'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1906 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', 'Samtlige Personers Navn (ogsaa Fornavn). Ved Børn, endnu uden Navn, sættes „Dreng“ eller „Pige“. Midlertidig fraværerade Personer anføres ikke her, men paa Skemaeta Bagside)'), diff --git a/app/Census/CensusOfDenmark1911.php b/app/Census/CensusOfDenmark1911.php index 904bb085c2..bb8047fdae 100644 --- a/app/Census/CensusOfDenmark1911.php +++ b/app/Census/CensusOfDenmark1911.php @@ -26,7 +26,7 @@ class CensusOfDenmark1911 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1911'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1911 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', 'Samtlige Personers Navn (ogsaa Fornavn). Ved Børn, endnu uden Navn, sættes „Dreng“ eller „Pige“. Midlertidig fraværerade Personer anføres ikke her, men paa Skemaeta Bagside)'), diff --git a/app/Census/CensusOfDenmark1916.php b/app/Census/CensusOfDenmark1916.php index 011425ae81..cda21d86f8 100644 --- a/app/Census/CensusOfDenmark1916.php +++ b/app/Census/CensusOfDenmark1916.php @@ -26,7 +26,7 @@ class CensusOfDenmark1916 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1916'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1916 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', 'Samtlige Personers Navn (ogsaa Fornavn). Ved Børn, endnu uden Navn, sættes „Dreng“ eller „Pige“. Midlertidig fraværerade Personer anføres ikke her, men paa Skemaeta Bagside)'), diff --git a/app/Census/CensusOfDenmark1921.php b/app/Census/CensusOfDenmark1921.php index 5e6cb00501..28a1d18155 100644 --- a/app/Census/CensusOfDenmark1921.php +++ b/app/Census/CensusOfDenmark1921.php @@ -26,7 +26,7 @@ class CensusOfDenmark1921 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 FEB 1921'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1921 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', 'Samtlige Personers Navn (ogsaa Fornavn). Ved Børn, endnu uden Navn, sættes „Dreng“ eller „Pige“. Midlertidig fraværerade Personer anføres ikke her, men paa Skemaeta Bagside)'), diff --git a/app/Census/CensusOfDenmark1925.php b/app/Census/CensusOfDenmark1925.php index d8839017a1..65f8ca3b5e 100644 --- a/app/Census/CensusOfDenmark1925.php +++ b/app/Census/CensusOfDenmark1925.php @@ -26,7 +26,7 @@ class CensusOfDenmark1925 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '05 NOV 1925'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1925 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Navn', 'Samtlige Personers Navn (ogsaa Fornavn). Ved Børn, endnu uden Navn, sættes „Dreng“ eller „Pige“. Midlertidig fraværerade Personer anføres ikke her, men paa Skemaeta Bagside)'), diff --git a/app/Census/CensusOfDenmark1930.php b/app/Census/CensusOfDenmark1930.php index d0e2c874db..9e8192b9f3 100644 --- a/app/Census/CensusOfDenmark1930.php +++ b/app/Census/CensusOfDenmark1930.php @@ -26,7 +26,7 @@ class CensusOfDenmark1930 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '05 NOV 1930'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1930 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurnameGivenNames($this, 'Navn', ''), diff --git a/app/Census/CensusOfDenmark1940.php b/app/Census/CensusOfDenmark1940.php index d1f54cbd89..65172542d7 100644 --- a/app/Census/CensusOfDenmark1940.php +++ b/app/Census/CensusOfDenmark1940.php @@ -26,7 +26,7 @@ class CensusOfDenmark1940 extends CensusOfDenmark implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '05 NOV 1940'; } @@ -36,7 +36,7 @@ class CensusOfDenmark1940 extends CensusOfDenmark implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurnameGivenNames($this, 'Navn', ''), diff --git a/app/Census/CensusOfDeutschland.php b/app/Census/CensusOfDeutschland.php index ac780ce431..ff09ae1570 100644 --- a/app/Census/CensusOfDeutschland.php +++ b/app/Census/CensusOfDeutschland.php @@ -26,7 +26,7 @@ class CensusOfDeutschland extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfDeutschland1819(), @@ -42,7 +42,7 @@ class CensusOfDeutschland extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Deutschland'; } diff --git a/app/Census/CensusOfDeutschland1819.php b/app/Census/CensusOfDeutschland1819.php index 05427f57ee..f99fa2470a 100644 --- a/app/Census/CensusOfDeutschland1819.php +++ b/app/Census/CensusOfDeutschland1819.php @@ -26,7 +26,7 @@ class CensusOfDeutschland1819 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusDate() + public function censusDate(): string { return 'AUG 1819'; } @@ -36,7 +36,7 @@ class CensusOfDeutschland1819 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Mecklenburg-Schwerin, Deutschland'; } @@ -46,7 +46,7 @@ class CensusOfDeutschland1819 extends CensusOfDeutschland implements CensusInter * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnNull($this, 'Nr.', 'Laufende Num̅er.'), diff --git a/app/Census/CensusOfDeutschland1867.php b/app/Census/CensusOfDeutschland1867.php index 5709569ffe..3fd384c3d7 100644 --- a/app/Census/CensusOfDeutschland1867.php +++ b/app/Census/CensusOfDeutschland1867.php @@ -26,7 +26,7 @@ class CensusOfDeutschland1867 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusDate() + public function censusDate(): string { return '03 DEC 1867'; } @@ -36,7 +36,7 @@ class CensusOfDeutschland1867 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Mecklenburg-Schwerin, Deutschland'; } @@ -46,7 +46,7 @@ class CensusOfDeutschland1867 extends CensusOfDeutschland implements CensusInter * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnNull($this, '1.Nr.', 'Ordnungs-Nummer (1-15).'), diff --git a/app/Census/CensusOfDeutschland1900.php b/app/Census/CensusOfDeutschland1900.php index 599a7a57dc..a61cb59460 100644 --- a/app/Census/CensusOfDeutschland1900.php +++ b/app/Census/CensusOfDeutschland1900.php @@ -26,7 +26,7 @@ class CensusOfDeutschland1900 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 DEC 1900'; } @@ -36,7 +36,7 @@ class CensusOfDeutschland1900 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Mecklenburg-Schwerin, Deutschland'; } @@ -46,7 +46,7 @@ class CensusOfDeutschland1900 extends CensusOfDeutschland implements CensusInter * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnNull($this, 'Lfd.Nr.', 'Laufende Nummer'), diff --git a/app/Census/CensusOfDeutschland1919.php b/app/Census/CensusOfDeutschland1919.php index c10cce7af8..5adb0f2067 100644 --- a/app/Census/CensusOfDeutschland1919.php +++ b/app/Census/CensusOfDeutschland1919.php @@ -26,7 +26,7 @@ class CensusOfDeutschland1919 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusDate() + public function censusDate(): string { return '08 OCT 1919'; } @@ -36,7 +36,7 @@ class CensusOfDeutschland1919 extends CensusOfDeutschland implements CensusInter * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Mecklenburg-Schwerin, Deutschland'; } @@ -46,7 +46,7 @@ class CensusOfDeutschland1919 extends CensusOfDeutschland implements CensusInter * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnNull($this, 'Nummer', 'Laufende Nummer'), diff --git a/app/Census/CensusOfDeutschlandNL1867.php b/app/Census/CensusOfDeutschlandNL1867.php index e4c5a29508..6961c643d0 100644 --- a/app/Census/CensusOfDeutschlandNL1867.php +++ b/app/Census/CensusOfDeutschlandNL1867.php @@ -26,7 +26,7 @@ class CensusOfDeutschlandNL1867 extends CensusOfDeutschland implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '03 DEC 1867'; } @@ -36,7 +36,7 @@ class CensusOfDeutschlandNL1867 extends CensusOfDeutschland implements CensusInt * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Mecklenburg-Schwerin (Nachtragsliste), Deutschland'; } @@ -46,7 +46,7 @@ class CensusOfDeutschlandNL1867 extends CensusOfDeutschland implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnNull($this, '1.Nr.', 'Ordnungs-Nummer.'), diff --git a/app/Census/CensusOfEngland.php b/app/Census/CensusOfEngland.php index c3309c59c9..fd8dc99439 100644 --- a/app/Census/CensusOfEngland.php +++ b/app/Census/CensusOfEngland.php @@ -26,7 +26,7 @@ class CensusOfEngland extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfEngland1841(), @@ -46,7 +46,7 @@ class CensusOfEngland extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'England'; } diff --git a/app/Census/CensusOfEngland1841.php b/app/Census/CensusOfEngland1841.php index e731a3a3d1..e3ffdb0bbc 100644 --- a/app/Census/CensusOfEngland1841.php +++ b/app/Census/CensusOfEngland1841.php @@ -26,7 +26,7 @@ class CensusOfEngland1841 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '06 JUN 1841'; } @@ -36,7 +36,7 @@ class CensusOfEngland1841 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfEngland1851.php b/app/Census/CensusOfEngland1851.php index 787c72651a..269bf4451e 100644 --- a/app/Census/CensusOfEngland1851.php +++ b/app/Census/CensusOfEngland1851.php @@ -26,7 +26,7 @@ class CensusOfEngland1851 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '30 MAR 1851'; } @@ -36,7 +36,7 @@ class CensusOfEngland1851 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfEngland1861.php b/app/Census/CensusOfEngland1861.php index 95070b156f..8c9942695c 100644 --- a/app/Census/CensusOfEngland1861.php +++ b/app/Census/CensusOfEngland1861.php @@ -26,7 +26,7 @@ class CensusOfEngland1861 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '07 APR 1861'; } @@ -36,7 +36,7 @@ class CensusOfEngland1861 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfEngland1871.php b/app/Census/CensusOfEngland1871.php index 25661288dc..a800fc0d35 100644 --- a/app/Census/CensusOfEngland1871.php +++ b/app/Census/CensusOfEngland1871.php @@ -26,7 +26,7 @@ class CensusOfEngland1871 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 APR 1871'; } @@ -36,7 +36,7 @@ class CensusOfEngland1871 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfEngland1881.php b/app/Census/CensusOfEngland1881.php index d10de087cb..d46504b1db 100644 --- a/app/Census/CensusOfEngland1881.php +++ b/app/Census/CensusOfEngland1881.php @@ -26,7 +26,7 @@ class CensusOfEngland1881 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '03 APR 1881'; } @@ -36,7 +36,7 @@ class CensusOfEngland1881 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfEngland1891.php b/app/Census/CensusOfEngland1891.php index 843689115b..22d65d3d4c 100644 --- a/app/Census/CensusOfEngland1891.php +++ b/app/Census/CensusOfEngland1891.php @@ -26,7 +26,7 @@ class CensusOfEngland1891 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '05 APR 1891'; } @@ -36,7 +36,7 @@ class CensusOfEngland1891 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfEngland1901.php b/app/Census/CensusOfEngland1901.php index a9380ae9e4..ee65f56e3e 100644 --- a/app/Census/CensusOfEngland1901.php +++ b/app/Census/CensusOfEngland1901.php @@ -26,7 +26,7 @@ class CensusOfEngland1901 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '31 MAR 1901'; } @@ -36,7 +36,7 @@ class CensusOfEngland1901 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfEngland1911.php b/app/Census/CensusOfEngland1911.php index b46d42ad9b..24d12da31f 100644 --- a/app/Census/CensusOfEngland1911.php +++ b/app/Census/CensusOfEngland1911.php @@ -26,7 +26,7 @@ class CensusOfEngland1911 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 APR 1911'; } @@ -36,7 +36,7 @@ class CensusOfEngland1911 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfFrance.php b/app/Census/CensusOfFrance.php index a3ff675847..0b4facdebd 100644 --- a/app/Census/CensusOfFrance.php +++ b/app/Census/CensusOfFrance.php @@ -26,7 +26,7 @@ class CensusOfFrance extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfFrance1831(), @@ -59,7 +59,7 @@ class CensusOfFrance extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'France'; } diff --git a/app/Census/CensusOfFrance1831.php b/app/Census/CensusOfFrance1831.php index cdbe761fe9..d9af03b5ea 100644 --- a/app/Census/CensusOfFrance1831.php +++ b/app/Census/CensusOfFrance1831.php @@ -26,7 +26,7 @@ class CensusOfFrance1831 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '20 JAN 1831'; } @@ -36,7 +36,7 @@ class CensusOfFrance1831 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1836.php b/app/Census/CensusOfFrance1836.php index 273468676d..5f8ff30490 100644 --- a/app/Census/CensusOfFrance1836.php +++ b/app/Census/CensusOfFrance1836.php @@ -26,7 +26,7 @@ class CensusOfFrance1836 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '21 JAN 1836'; } @@ -36,7 +36,7 @@ class CensusOfFrance1836 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1841.php b/app/Census/CensusOfFrance1841.php index b4bee9fa6f..6bfebb9afe 100644 --- a/app/Census/CensusOfFrance1841.php +++ b/app/Census/CensusOfFrance1841.php @@ -26,7 +26,7 @@ class CensusOfFrance1841 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '21 JAN 1841'; } @@ -36,7 +36,7 @@ class CensusOfFrance1841 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1846.php b/app/Census/CensusOfFrance1846.php index c5c0b3d104..5cbc204007 100644 --- a/app/Census/CensusOfFrance1846.php +++ b/app/Census/CensusOfFrance1846.php @@ -26,7 +26,7 @@ class CensusOfFrance1846 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '15 JAN 1846'; } @@ -36,7 +36,7 @@ class CensusOfFrance1846 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1851.php b/app/Census/CensusOfFrance1851.php index f0542330f8..056e4ed7e4 100644 --- a/app/Census/CensusOfFrance1851.php +++ b/app/Census/CensusOfFrance1851.php @@ -26,7 +26,7 @@ class CensusOfFrance1851 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '16 JAN 1851'; } @@ -36,7 +36,7 @@ class CensusOfFrance1851 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1856.php b/app/Census/CensusOfFrance1856.php index 4192bed93a..5b82c67757 100644 --- a/app/Census/CensusOfFrance1856.php +++ b/app/Census/CensusOfFrance1856.php @@ -26,7 +26,7 @@ class CensusOfFrance1856 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '17 JAN 1856'; } @@ -36,7 +36,7 @@ class CensusOfFrance1856 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1861.php b/app/Census/CensusOfFrance1861.php index 7423358d80..f7a215f3bf 100644 --- a/app/Census/CensusOfFrance1861.php +++ b/app/Census/CensusOfFrance1861.php @@ -26,7 +26,7 @@ class CensusOfFrance1861 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '17 JAN 1861'; } @@ -36,7 +36,7 @@ class CensusOfFrance1861 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1866.php b/app/Census/CensusOfFrance1866.php index 220c8f3943..ab30be205d 100644 --- a/app/Census/CensusOfFrance1866.php +++ b/app/Census/CensusOfFrance1866.php @@ -26,7 +26,7 @@ class CensusOfFrance1866 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '18 JAN 1866'; } @@ -36,7 +36,7 @@ class CensusOfFrance1866 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1872.php b/app/Census/CensusOfFrance1872.php index 5103fe24ad..2ec77b2783 100644 --- a/app/Census/CensusOfFrance1872.php +++ b/app/Census/CensusOfFrance1872.php @@ -26,7 +26,7 @@ class CensusOfFrance1872 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '18 JAN 1872'; } @@ -36,7 +36,7 @@ class CensusOfFrance1872 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1876.php b/app/Census/CensusOfFrance1876.php index 2809ca70bc..dcd9f02685 100644 --- a/app/Census/CensusOfFrance1876.php +++ b/app/Census/CensusOfFrance1876.php @@ -26,7 +26,7 @@ class CensusOfFrance1876 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '20 JAN 1876'; } @@ -36,7 +36,7 @@ class CensusOfFrance1876 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1881.php b/app/Census/CensusOfFrance1881.php index d311106a7b..d4100550ff 100644 --- a/app/Census/CensusOfFrance1881.php +++ b/app/Census/CensusOfFrance1881.php @@ -26,7 +26,7 @@ class CensusOfFrance1881 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '20 JAN 1881'; } @@ -36,7 +36,7 @@ class CensusOfFrance1881 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1886.php b/app/Census/CensusOfFrance1886.php index abd2010088..108ba3dc5c 100644 --- a/app/Census/CensusOfFrance1886.php +++ b/app/Census/CensusOfFrance1886.php @@ -26,7 +26,7 @@ class CensusOfFrance1886 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '21 JAN 1886'; } @@ -36,7 +36,7 @@ class CensusOfFrance1886 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1891.php b/app/Census/CensusOfFrance1891.php index 40688392cc..4bcc03e603 100644 --- a/app/Census/CensusOfFrance1891.php +++ b/app/Census/CensusOfFrance1891.php @@ -26,7 +26,7 @@ class CensusOfFrance1891 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '15 JAN 1891'; } @@ -36,7 +36,7 @@ class CensusOfFrance1891 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1896.php b/app/Census/CensusOfFrance1896.php index 312bfeb65b..d14c35113e 100644 --- a/app/Census/CensusOfFrance1896.php +++ b/app/Census/CensusOfFrance1896.php @@ -26,7 +26,7 @@ class CensusOfFrance1896 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '16 JAN 1896'; } @@ -36,7 +36,7 @@ class CensusOfFrance1896 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1901.php b/app/Census/CensusOfFrance1901.php index fe4751b1b0..13b329303c 100644 --- a/app/Census/CensusOfFrance1901.php +++ b/app/Census/CensusOfFrance1901.php @@ -26,7 +26,7 @@ class CensusOfFrance1901 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '17 JAN 1901'; } @@ -36,7 +36,7 @@ class CensusOfFrance1901 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1906.php b/app/Census/CensusOfFrance1906.php index e7eb0a5159..88b108062d 100644 --- a/app/Census/CensusOfFrance1906.php +++ b/app/Census/CensusOfFrance1906.php @@ -26,7 +26,7 @@ class CensusOfFrance1906 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '18 JAN 1906'; } @@ -36,7 +36,7 @@ class CensusOfFrance1906 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1911.php b/app/Census/CensusOfFrance1911.php index ba98ffdc3e..66be2f2252 100644 --- a/app/Census/CensusOfFrance1911.php +++ b/app/Census/CensusOfFrance1911.php @@ -26,7 +26,7 @@ class CensusOfFrance1911 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '19 JAN 1911'; } @@ -36,7 +36,7 @@ class CensusOfFrance1911 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1921.php b/app/Census/CensusOfFrance1921.php index 4cdead8a02..e161945707 100644 --- a/app/Census/CensusOfFrance1921.php +++ b/app/Census/CensusOfFrance1921.php @@ -26,7 +26,7 @@ class CensusOfFrance1921 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '20 JAN 1921'; } @@ -36,7 +36,7 @@ class CensusOfFrance1921 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1926.php b/app/Census/CensusOfFrance1926.php index 0f2acc04f1..4507fab74a 100644 --- a/app/Census/CensusOfFrance1926.php +++ b/app/Census/CensusOfFrance1926.php @@ -26,7 +26,7 @@ class CensusOfFrance1926 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '21 JAN 1926'; } @@ -36,7 +36,7 @@ class CensusOfFrance1926 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1931.php b/app/Census/CensusOfFrance1931.php index cafd970f18..88f8b5d810 100644 --- a/app/Census/CensusOfFrance1931.php +++ b/app/Census/CensusOfFrance1931.php @@ -26,7 +26,7 @@ class CensusOfFrance1931 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '15 JAN 1931'; } @@ -36,7 +36,7 @@ class CensusOfFrance1931 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1936.php b/app/Census/CensusOfFrance1936.php index e1555a84aa..240dce19f6 100644 --- a/app/Census/CensusOfFrance1936.php +++ b/app/Census/CensusOfFrance1936.php @@ -26,7 +26,7 @@ class CensusOfFrance1936 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '16 JAN 1936'; } @@ -36,7 +36,7 @@ class CensusOfFrance1936 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Noms', 'Noms de famille'), diff --git a/app/Census/CensusOfFrance1946.php b/app/Census/CensusOfFrance1946.php index 5b29fdce11..768475913e 100644 --- a/app/Census/CensusOfFrance1946.php +++ b/app/Census/CensusOfFrance1946.php @@ -26,7 +26,7 @@ class CensusOfFrance1946 extends CensusOfFrance implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '17 JAN 1946'; } @@ -36,7 +36,7 @@ class CensusOfFrance1946 extends CensusOfFrance implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurname($this, 'Nom', 'Nom de famille'), diff --git a/app/Census/CensusOfScotland.php b/app/Census/CensusOfScotland.php index 60f003d7e4..713a0c57c0 100644 --- a/app/Census/CensusOfScotland.php +++ b/app/Census/CensusOfScotland.php @@ -26,7 +26,7 @@ class CensusOfScotland extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfScotland1841(), @@ -45,7 +45,7 @@ class CensusOfScotland extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Scotland'; } diff --git a/app/Census/CensusOfScotland1841.php b/app/Census/CensusOfScotland1841.php index 76a1fca9e7..cded92d798 100644 --- a/app/Census/CensusOfScotland1841.php +++ b/app/Census/CensusOfScotland1841.php @@ -26,7 +26,7 @@ class CensusOfScotland1841 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '06 JUN 1841'; } @@ -36,7 +36,7 @@ class CensusOfScotland1841 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfScotland1851.php b/app/Census/CensusOfScotland1851.php index e06474c850..de7fba2a61 100644 --- a/app/Census/CensusOfScotland1851.php +++ b/app/Census/CensusOfScotland1851.php @@ -26,7 +26,7 @@ class CensusOfScotland1851 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '30 MAR 1851'; } @@ -36,7 +36,7 @@ class CensusOfScotland1851 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfScotland1861.php b/app/Census/CensusOfScotland1861.php index 426666c7b2..787f475644 100644 --- a/app/Census/CensusOfScotland1861.php +++ b/app/Census/CensusOfScotland1861.php @@ -26,7 +26,7 @@ class CensusOfScotland1861 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '07 APR 1861'; } @@ -36,7 +36,7 @@ class CensusOfScotland1861 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfScotland1871.php b/app/Census/CensusOfScotland1871.php index 93f796b1bc..ae131a79ad 100644 --- a/app/Census/CensusOfScotland1871.php +++ b/app/Census/CensusOfScotland1871.php @@ -26,7 +26,7 @@ class CensusOfScotland1871 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 APR 1871'; } @@ -36,7 +36,7 @@ class CensusOfScotland1871 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfScotland1881.php b/app/Census/CensusOfScotland1881.php index 9f562b4aa3..993da863d9 100644 --- a/app/Census/CensusOfScotland1881.php +++ b/app/Census/CensusOfScotland1881.php @@ -26,7 +26,7 @@ class CensusOfScotland1881 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '03 APR 1881'; } @@ -36,7 +36,7 @@ class CensusOfScotland1881 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfScotland1891.php b/app/Census/CensusOfScotland1891.php index 810c4abf00..c9a5b5f715 100644 --- a/app/Census/CensusOfScotland1891.php +++ b/app/Census/CensusOfScotland1891.php @@ -26,7 +26,7 @@ class CensusOfScotland1891 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '05 APR 1891'; } @@ -36,7 +36,7 @@ class CensusOfScotland1891 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfScotland1901.php b/app/Census/CensusOfScotland1901.php index 0f84ab52bc..411443654d 100644 --- a/app/Census/CensusOfScotland1901.php +++ b/app/Census/CensusOfScotland1901.php @@ -26,7 +26,7 @@ class CensusOfScotland1901 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '31 MAR 1901'; } @@ -36,7 +36,7 @@ class CensusOfScotland1901 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfScotland1911.php b/app/Census/CensusOfScotland1911.php index 7717fa1e97..b9acb48468 100644 --- a/app/Census/CensusOfScotland1911.php +++ b/app/Census/CensusOfScotland1911.php @@ -26,7 +26,7 @@ class CensusOfScotland1911 extends CensusOfScotland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 APR 1911'; } @@ -36,7 +36,7 @@ class CensusOfScotland1911 extends CensusOfScotland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfUnitedStates.php b/app/Census/CensusOfUnitedStates.php index d97409ade8..d5e9ddcc60 100644 --- a/app/Census/CensusOfUnitedStates.php +++ b/app/Census/CensusOfUnitedStates.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfUnitedStates1790(), @@ -53,7 +53,7 @@ class CensusOfUnitedStates extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'United States'; } diff --git a/app/Census/CensusOfUnitedStates1790.php b/app/Census/CensusOfUnitedStates1790.php index ecbb9351d0..9f6def429a 100644 --- a/app/Census/CensusOfUnitedStates1790.php +++ b/app/Census/CensusOfUnitedStates1790.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1790 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 AUG 1790'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1790 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name of head of family'), diff --git a/app/Census/CensusOfUnitedStates1800.php b/app/Census/CensusOfUnitedStates1800.php index c7114c5b37..4140bef166 100644 --- a/app/Census/CensusOfUnitedStates1800.php +++ b/app/Census/CensusOfUnitedStates1800.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1800 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '04 AUG 1800'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1800 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name of head of family'), diff --git a/app/Census/CensusOfUnitedStates1810.php b/app/Census/CensusOfUnitedStates1810.php index 12a351d2b4..96aa2ec93a 100644 --- a/app/Census/CensusOfUnitedStates1810.php +++ b/app/Census/CensusOfUnitedStates1810.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1810 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '06 AUG 1810'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1810 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name of head of family'), diff --git a/app/Census/CensusOfUnitedStates1820.php b/app/Census/CensusOfUnitedStates1820.php index ed24948b83..2922178233 100644 --- a/app/Census/CensusOfUnitedStates1820.php +++ b/app/Census/CensusOfUnitedStates1820.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1820 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '07 AUG 1820'; } @@ -37,7 +37,7 @@ class CensusOfUnitedStates1820 extends CensusOfUnitedStates implements CensusInt * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name of head of family'), diff --git a/app/Census/CensusOfUnitedStates1830.php b/app/Census/CensusOfUnitedStates1830.php index e5d939b208..df530957da 100644 --- a/app/Census/CensusOfUnitedStates1830.php +++ b/app/Census/CensusOfUnitedStates1830.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1830 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 JUN 1830'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1830 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name of head of family'), diff --git a/app/Census/CensusOfUnitedStates1840.php b/app/Census/CensusOfUnitedStates1840.php index 169291f565..cd8df13a00 100644 --- a/app/Census/CensusOfUnitedStates1840.php +++ b/app/Census/CensusOfUnitedStates1840.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1840 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 JUN 1840'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1840 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ diff --git a/app/Census/CensusOfUnitedStates1850.php b/app/Census/CensusOfUnitedStates1850.php index 7d33ab79eb..cf9f83ecdf 100644 --- a/app/Census/CensusOfUnitedStates1850.php +++ b/app/Census/CensusOfUnitedStates1850.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1850 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 JUN 1850'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1850 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1860.php b/app/Census/CensusOfUnitedStates1860.php index 2405674fc4..5982c6e61f 100644 --- a/app/Census/CensusOfUnitedStates1860.php +++ b/app/Census/CensusOfUnitedStates1860.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1860 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return 'BET JUN 1860 AND OCT 1860'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1860 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1870.php b/app/Census/CensusOfUnitedStates1870.php index 9d7b8f0938..03166b90a2 100644 --- a/app/Census/CensusOfUnitedStates1870.php +++ b/app/Census/CensusOfUnitedStates1870.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1870 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return 'JUN 1870'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1870 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1880.php b/app/Census/CensusOfUnitedStates1880.php index 946d74255f..7e21c07205 100644 --- a/app/Census/CensusOfUnitedStates1880.php +++ b/app/Census/CensusOfUnitedStates1880.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1880 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return 'JUN 1880'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1880 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1890.php b/app/Census/CensusOfUnitedStates1890.php index b240f52990..e40ce724d0 100644 --- a/app/Census/CensusOfUnitedStates1890.php +++ b/app/Census/CensusOfUnitedStates1890.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1890 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 JUN 1890'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1890 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnGivenNameInitial($this, 'Name', 'Christian name in full, and initial of middle name'), diff --git a/app/Census/CensusOfUnitedStates1900.php b/app/Census/CensusOfUnitedStates1900.php index 5cc9f206e4..8c9581c123 100644 --- a/app/Census/CensusOfUnitedStates1900.php +++ b/app/Census/CensusOfUnitedStates1900.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1900 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '01 JUN 1900'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1900 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1910.php b/app/Census/CensusOfUnitedStates1910.php index def1763616..2abdb277e0 100644 --- a/app/Census/CensusOfUnitedStates1910.php +++ b/app/Census/CensusOfUnitedStates1910.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1910 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return '15 APR 1910'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1910 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurnameGivenNameInitial($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1920.php b/app/Census/CensusOfUnitedStates1920.php index ebdb973c41..060c4f6696 100644 --- a/app/Census/CensusOfUnitedStates1920.php +++ b/app/Census/CensusOfUnitedStates1920.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1920 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return 'JAN 1920'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1920 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnSurnameGivenNameInitial($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1930.php b/app/Census/CensusOfUnitedStates1930.php index 20e11ba098..cfdfc1d7dc 100644 --- a/app/Census/CensusOfUnitedStates1930.php +++ b/app/Census/CensusOfUnitedStates1930.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1930 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return 'APR 1930'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1930 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfUnitedStates1940.php b/app/Census/CensusOfUnitedStates1940.php index 44c35cfc26..e3ba586a7e 100644 --- a/app/Census/CensusOfUnitedStates1940.php +++ b/app/Census/CensusOfUnitedStates1940.php @@ -26,7 +26,7 @@ class CensusOfUnitedStates1940 extends CensusOfUnitedStates implements CensusInt * * @return string */ - public function censusDate() + public function censusDate(): string { return 'APR 1940'; } @@ -36,7 +36,7 @@ class CensusOfUnitedStates1940 extends CensusOfUnitedStates implements CensusInt * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfWales.php b/app/Census/CensusOfWales.php index dc6537105e..eb96b279dd 100644 --- a/app/Census/CensusOfWales.php +++ b/app/Census/CensusOfWales.php @@ -26,7 +26,7 @@ class CensusOfWales extends Census implements CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates() + public function allCensusDates(): array { return [ new CensusOfWales1841(), @@ -46,7 +46,7 @@ class CensusOfWales extends Census implements CensusPlaceInterface * * @return string */ - public function censusPlace() + public function censusPlace(): string { return 'Wales'; } diff --git a/app/Census/CensusOfWales1841.php b/app/Census/CensusOfWales1841.php index 60c157de87..322b76d412 100644 --- a/app/Census/CensusOfWales1841.php +++ b/app/Census/CensusOfWales1841.php @@ -26,7 +26,7 @@ class CensusOfWales1841 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '06 JUN 1841'; } @@ -36,7 +36,7 @@ class CensusOfWales1841 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name'), diff --git a/app/Census/CensusOfWales1851.php b/app/Census/CensusOfWales1851.php index f1d3f521f2..a49f95a8d8 100644 --- a/app/Census/CensusOfWales1851.php +++ b/app/Census/CensusOfWales1851.php @@ -26,7 +26,7 @@ class CensusOfWales1851 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '30 MAR 1851'; } @@ -36,7 +36,7 @@ class CensusOfWales1851 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfWales1861.php b/app/Census/CensusOfWales1861.php index 7956396a6a..ff31ba8e5d 100644 --- a/app/Census/CensusOfWales1861.php +++ b/app/Census/CensusOfWales1861.php @@ -26,7 +26,7 @@ class CensusOfWales1861 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '07 APR 1861'; } @@ -36,7 +36,7 @@ class CensusOfWales1861 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfWales1871.php b/app/Census/CensusOfWales1871.php index 9ca423a849..81d6a22094 100644 --- a/app/Census/CensusOfWales1871.php +++ b/app/Census/CensusOfWales1871.php @@ -26,7 +26,7 @@ class CensusOfWales1871 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 APR 1871'; } @@ -36,7 +36,7 @@ class CensusOfWales1871 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfWales1881.php b/app/Census/CensusOfWales1881.php index fae9ea84c9..d4c983b224 100644 --- a/app/Census/CensusOfWales1881.php +++ b/app/Census/CensusOfWales1881.php @@ -26,7 +26,7 @@ class CensusOfWales1881 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '03 APR 1881'; } @@ -36,7 +36,7 @@ class CensusOfWales1881 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfWales1891.php b/app/Census/CensusOfWales1891.php index 4520c0ef73..e3c58074f1 100644 --- a/app/Census/CensusOfWales1891.php +++ b/app/Census/CensusOfWales1891.php @@ -26,7 +26,7 @@ class CensusOfWales1891 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '05 APR 1891'; } @@ -36,7 +36,7 @@ class CensusOfWales1891 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfWales1901.php b/app/Census/CensusOfWales1901.php index a2de81f00d..76f34d6287 100644 --- a/app/Census/CensusOfWales1901.php +++ b/app/Census/CensusOfWales1901.php @@ -26,7 +26,7 @@ class CensusOfWales1901 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '31 MAR 1901'; } @@ -36,7 +36,7 @@ class CensusOfWales1901 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusOfWales1911.php b/app/Census/CensusOfWales1911.php index c9580f56cb..d0d4863907 100644 --- a/app/Census/CensusOfWales1911.php +++ b/app/Census/CensusOfWales1911.php @@ -26,7 +26,7 @@ class CensusOfWales1911 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '02 APR 1911'; } @@ -36,7 +36,7 @@ class CensusOfWales1911 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnFullName($this, 'Name', 'Name and surname'), diff --git a/app/Census/CensusPlaceInterface.php b/app/Census/CensusPlaceInterface.php index 493dbea8ad..b4e6bcf93d 100644 --- a/app/Census/CensusPlaceInterface.php +++ b/app/Census/CensusPlaceInterface.php @@ -26,12 +26,12 @@ interface CensusPlaceInterface * * @return CensusInterface[] */ - public function allCensusDates(); + public function allCensusDates(): array; /** * Where did this census occur, in GEDCOM format. * * @return string */ - public function censusPlace(); + public function censusPlace(): string; } diff --git a/app/Census/RegisterOfEngland1939.php b/app/Census/RegisterOfEngland1939.php index 435415b883..cf5a35ecb3 100644 --- a/app/Census/RegisterOfEngland1939.php +++ b/app/Census/RegisterOfEngland1939.php @@ -26,7 +26,7 @@ class RegisterOfEngland1939 extends CensusOfEngland implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '29 SEP 1939'; } @@ -36,7 +36,7 @@ class RegisterOfEngland1939 extends CensusOfEngland implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnNull($this, 'Schedule', 'Schedule Number'), diff --git a/app/Census/RegisterOfWales1939.php b/app/Census/RegisterOfWales1939.php index d747d02415..5f8bf6a275 100644 --- a/app/Census/RegisterOfWales1939.php +++ b/app/Census/RegisterOfWales1939.php @@ -26,7 +26,7 @@ class RegisterOfWales1939 extends CensusOfWales implements CensusInterface * * @return string */ - public function censusDate() + public function censusDate(): string { return '29 SEP 1939'; } @@ -36,7 +36,7 @@ class RegisterOfWales1939 extends CensusOfWales implements CensusInterface * * @return CensusColumnInterface[] */ - public function columns() + public function columns(): array { return [ new CensusColumnNull($this, 'Schedule', 'Schedule Number'), diff --git a/app/ColorGenerator.php b/app/ColorGenerator.php index e8b7340c3c..91048762f5 100644 --- a/app/ColorGenerator.php +++ b/app/ColorGenerator.php @@ -73,7 +73,7 @@ class ColorGenerator * * @return string */ - public function getNextColor($lightnessStep = 10, $hueStep = 15) + public function getNextColor($lightnessStep = 10, $hueStep = 15): string { $lightness = $this->lightness + $lightnessStep; $hue = $this->hue; diff --git a/app/CommonMark/CensusTableExtension.php b/app/CommonMark/CensusTableExtension.php index d96139736d..4404bb9d77 100644 --- a/app/CommonMark/CensusTableExtension.php +++ b/app/CommonMark/CensusTableExtension.php @@ -40,7 +40,7 @@ class CensusTableExtension extends Extension * * @return BlockParserInterface[] */ - public function getBlockParsers() + public function getBlockParsers(): array { return [ new CensusTableParser(), @@ -54,7 +54,7 @@ class CensusTableExtension extends Extension * * @return BlockRendererInterface[] */ - public function getBlockRenderers() + public function getBlockRenderers(): array { return [ Table::class => new TableRenderer(), @@ -67,7 +67,7 @@ class CensusTableExtension extends Extension /** * @return string */ - public function getName() + public function getName(): string { return 'censustabletable'; } diff --git a/app/CommonMark/CensusTableParser.php b/app/CommonMark/CensusTableParser.php index e8535b71d7..b6aacccb9e 100644 --- a/app/CommonMark/CensusTableParser.php +++ b/app/CommonMark/CensusTableParser.php @@ -45,7 +45,7 @@ class CensusTableParser extends AbstractBlockParser * * @return bool */ - public function parse(ContextInterface $context, Cursor $cursor) + public function parse(ContextInterface $context, Cursor $cursor): bool { $container = $context->getContainer(); diff --git a/app/CommonMark/XrefExtension.php b/app/CommonMark/XrefExtension.php index fc0d52bbc1..891c256dfa 100644 --- a/app/CommonMark/XrefExtension.php +++ b/app/CommonMark/XrefExtension.php @@ -39,7 +39,7 @@ class XrefExtension extends Extension /** * @return array */ - public function getInlineParsers() + public function getInlineParsers(): array { return [ new XrefParser($this->tree), @@ -49,7 +49,7 @@ class XrefExtension extends Extension /** * @return string */ - public function getName() + public function getName(): string { return 'xref'; } diff --git a/app/CommonMark/XrefParser.php b/app/CommonMark/XrefParser.php index 3ec057b6e0..d0c09591e5 100644 --- a/app/CommonMark/XrefParser.php +++ b/app/CommonMark/XrefParser.php @@ -44,7 +44,7 @@ class XrefParser extends AbstractInlineParser * * @return array */ - public function getCharacters() + public function getCharacters(): array { return ['@']; } @@ -54,7 +54,7 @@ class XrefParser extends AbstractInlineParser * * @return bool */ - public function parse(InlineParserContext $context) + public function parse(InlineParserContext $context): bool { // The cursor should be positioned on the opening '@'. $cursor = $context->getCursor(); diff --git a/app/Config.php b/app/Config.php index 68824e1e28..6ed24bd8dc 100644 --- a/app/Config.php +++ b/app/Config.php @@ -26,7 +26,7 @@ class Config * * @return string[] */ - public static function namePrefixes() + public static function namePrefixes(): array { return [ 'Adm', @@ -72,7 +72,7 @@ class Config * * @return string[] */ - public static function fileFormats() + public static function fileFormats(): array { return [ 'avi', @@ -93,7 +93,7 @@ class Config * * return string[] */ - public static function emptyFacts() + public static function emptyFacts(): array { return [ 'ADOP', @@ -150,7 +150,7 @@ class Config * * @return string[] */ - public static function nonPlaceFacts() + public static function nonPlaceFacts(): array { return [ 'ENDL', @@ -166,7 +166,7 @@ class Config * * @return string[] */ - public static function nonDateFacts() + public static function nonDateFacts(): array { return [ 'ABBR', @@ -203,7 +203,7 @@ class Config * * @return string[] */ - public static function dateAndTime() + public static function dateAndTime(): array { return [ 'BIRT', @@ -217,7 +217,7 @@ class Config * * @return string[][] */ - public static function levelTwoTags() + public static function levelTwoTags(): array { return [ 'TYPE' => [ @@ -430,7 +430,7 @@ class Config * * @return string[] */ - public static function twoAssociates() + public static function twoAssociates(): array { return [ 'CHR', diff --git a/app/Database.php b/app/Database.php index 1475dbd428..8fef379125 100644 --- a/app/Database.php +++ b/app/Database.php @@ -49,7 +49,7 @@ class Database * * @return bool */ - public static function beginTransaction() + public static function beginTransaction(): bool { return self::$pdo->beginTransaction(); } @@ -59,7 +59,7 @@ class Database * * @return bool */ - public static function commit() + public static function commit(): bool { return self::$pdo->commit(); } @@ -125,7 +125,7 @@ class Database * * @return bool */ - public static function isConnected() + public static function isConnected(): bool { return self::$pdo !== null; } @@ -135,7 +135,7 @@ class Database * * @return string */ - public static function lastInsertId() + public static function lastInsertId(): string { return self::$pdo->lastInsertId(); } @@ -167,7 +167,7 @@ class Database * * @return int The number of rows affected by this SQL query */ - public static function exec($sql) + public static function exec($sql): int { $sql = str_replace('##', self::$table_prefix, $sql); @@ -183,7 +183,7 @@ class Database * * @return Statement */ - public static function prepare($sql) + public static function prepare($sql): Statement { if (self::$pdo === null) { throw new Exception('No Connection Established'); @@ -203,7 +203,7 @@ class Database * * @return bool */ - public static function rollBack() + public static function rollBack(): bool { return self::$pdo->rollBack(); } @@ -219,7 +219,7 @@ class Database * * @return bool Were any updates applied */ - public static function updateSchema($namespace, $schema_name, $target_version) + public static function updateSchema($namespace, $schema_name, $target_version): bool { try { $current_version = (int)Site::getPreference($schema_name); @@ -253,7 +253,7 @@ class Database * * @return string */ - public static function escapeLike($string) + public static function escapeLike($string): string { return strtr( $string, diff --git a/app/Datatables.php b/app/Datatables.php index 1565fc9244..820bb4ff1b 100644 --- a/app/Datatables.php +++ b/app/Datatables.php @@ -36,8 +36,7 @@ class Datatables 25, 100, -1, - ]) - { + ]): array { $length_menu = FunctionsEdit::numericOptions($lengths); $language = [ @@ -79,7 +78,7 @@ class Datatables * * @return string */ - public static function eventTableAttributes() + public static function eventTableAttributes(): string { return Html::attributes([ 'class' => 'table table-bordered table-sm datatables table-event', @@ -96,7 +95,7 @@ class Datatables * * @return string */ - public static function givenNameTableAttributes() + public static function givenNameTableAttributes(): string { return Html::attributes([ 'class' => 'table table-bordered table-sm datatables table-given-name', diff --git a/app/Date.php b/app/Date.php index 84d50af7f8..3577a7aea1 100644 --- a/app/Date.php +++ b/app/Date.php @@ -225,7 +225,7 @@ class Date * * @return string[] */ - public static function calendarNames() + public static function calendarNames(): array { return [ /* I18N: The gregorian calendar */ @@ -397,7 +397,7 @@ class Date * * @return CalendarDate */ - public function minimumDate() + public function minimumDate(): CalendarDate { return $this->date1; } @@ -423,7 +423,7 @@ class Date * * @return int */ - public function minimumJulianDay() + public function minimumJulianDay(): int { return $this->minimumDate()->minJD; } @@ -433,7 +433,7 @@ class Date * * @return int */ - public function maximumJulianDay() + public function maximumJulianDay(): int { return $this->maximumDate()->maxJD; } @@ -446,7 +446,7 @@ class Date * * @return int */ - public function julianDay() + public function julianDay(): int { return (int)(($this->minimumJulianDay() + $this->maximumJulianDay()) / 2); } @@ -462,7 +462,7 @@ class Date * * @return Date */ - public function addYears(int $years, string $qualifier = '') + public function addYears(int $years, string $qualifier = ''): Date { $tmp = clone $this; $tmp->date1->y += $years; @@ -623,7 +623,7 @@ class Date * * @return bool */ - public function isOK() + public function isOK(): bool { return $this->minimumJulianDay() && $this->maximumJulianDay(); } diff --git a/app/Fact.php b/app/Fact.php index 3aa83bd964..0dc5cd9f81 100644 --- a/app/Fact.php +++ b/app/Fact.php @@ -246,7 +246,7 @@ class Fact * * @return bool */ - public function canShow($access_level = null) + public function canShow($access_level = null): bool { if ($access_level === null) { $access_level = Auth::accessLevel($this->getParent()->getTree()); @@ -283,7 +283,7 @@ class Fact * * @return bool */ - public function canEdit() + public function canEdit(): bool { // Managers can edit anything // Members cannot edit RESN, CHAN and locked records @@ -299,7 +299,7 @@ class Fact * * @return Place */ - public function getPlace() + public function getPlace(): Place { if ($this->place === null) { $this->place = new Place($this->getAttribute('PLAC'), $this->getParent()->getTree()); @@ -315,7 +315,7 @@ class Fact * * @return Date */ - public function getDate() + public function getDate(): Date { if ($this->date === null) { $this->date = new Date($this->getAttribute('DATE')); @@ -329,7 +329,7 @@ class Fact * * @return string */ - public function getGedcom() + public function getGedcom(): string { return $this->gedcom; } @@ -339,7 +339,7 @@ class Fact * * @return string */ - public function getFactId() + public function getFactId(): string { return $this->fact_id; } @@ -349,7 +349,7 @@ class Fact * * @return string */ - public function getTag() + public function getTag(): string { return $this->tag; } @@ -379,7 +379,7 @@ class Fact * * @return string */ - public function getLabel() + public function getLabel(): string { // Custom FACT/EVEN - with a TYPE if (($this->tag === 'FACT' || $this->tag === 'EVEN') && $this->getAttribute('TYPE') !== '') { @@ -403,7 +403,7 @@ class Fact * * @return bool */ - public function isPendingDeletion() + public function isPendingDeletion(): bool { return $this->pending_deletion; } @@ -422,7 +422,7 @@ class Fact * * @return bool */ - public function isPendingAddition() + public function isPendingAddition(): bool { return $this->pending_addition; } @@ -432,7 +432,7 @@ class Fact * * @return string[] */ - public function getCitations() + public function getCitations(): array { preg_match_all('/\n(2 SOUR @(' . WT_REGEX_XREF . ')@(?:\n[3-9] .*)*)/', $this->getGedcom(), $matches, PREG_SET_ORDER); $citations = []; @@ -451,7 +451,7 @@ class Fact * * @return string[]|Note[] */ - public function getNotes() + public function getNotes(): array { $notes = []; preg_match_all('/\n2 NOTE ?(.*(?:\n3.*)*)/', $this->getGedcom(), $matches); @@ -477,7 +477,7 @@ class Fact * * @return Media[] */ - public function getMedia() + public function getMedia(): array { $media = []; preg_match_all('/\n2 OBJE @(' . WT_REGEX_XREF . ')@/', $this->getGedcom(), $matches); @@ -496,7 +496,7 @@ class Fact * * @return string */ - public function summary() + public function summary(): string { $attributes = []; $target = $this->getTarget(); @@ -576,7 +576,7 @@ class Fact * * @return int */ - public static function compareType(Fact $a, Fact $b) + public static function compareType(Fact $a, Fact $b): int { static $factsort = []; diff --git a/app/FactLocation.php b/app/FactLocation.php index 768e825c8c..a4b2f1e4f1 100644 --- a/app/FactLocation.php +++ b/app/FactLocation.php @@ -51,7 +51,7 @@ class FactLocation extends Location * * @return array */ - public function shortSummary($datatype, $sosa) + public function shortSummary($datatype, $sosa): array { $self = $this->indi->getXref(); $parent = $this->fact->getParent(); @@ -93,7 +93,7 @@ class FactLocation extends Location /** * @return array */ - public function getIconDetails() + public function getIconDetails(): array { $tag = $this->fact->getTag(); if (false !== stripos(WT_EVENTS_BIRT, $tag)) { diff --git a/app/Family.php b/app/Family.php index 4cf14cbdaa..4487af6190 100644 --- a/app/Family.php +++ b/app/Family.php @@ -94,7 +94,7 @@ class Family extends GedcomRecord * * @return string */ - protected function createPrivateGedcomRecord($access_level) + protected function createPrivateGedcomRecord($access_level): string { $SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS'); @@ -172,7 +172,7 @@ class Family extends GedcomRecord * * @return bool */ - protected function canShowByType($access_level) + protected function canShowByType($access_level): bool { // Hide a family if any member is private preg_match_all('/\n1 (?:CHIL|HUSB|WIFE) @(' . WT_REGEX_XREF . ')@/', $this->gedcom, $matches); @@ -193,7 +193,7 @@ class Family extends GedcomRecord * * @return bool */ - public function canShowName($access_level = null) + public function canShowName($access_level = null): bool { // We can always see the name (Husband-name + Wife-name), however, // the name will often be "private + private" @@ -224,7 +224,7 @@ class Family extends GedcomRecord * * @return Individual[] */ - public function getSpouses($access_level = null) + public function getSpouses($access_level = null): array { return array_filter([ $this->getHusband($access_level), @@ -239,7 +239,7 @@ class Family extends GedcomRecord * * @return Individual[] */ - public function getChildren($access_level = null) + public function getChildren($access_level = null): array { if ($access_level === null) { $access_level = Auth::accessLevel($this->tree); @@ -266,7 +266,7 @@ class Family extends GedcomRecord * * @return int */ - public static function compareMarrDate(Family $x, Family $y) + public static function compareMarrDate(Family $x, Family $y): int { return Date::compare($x->getMarriageDate(), $y->getMarriageDate()); } @@ -276,7 +276,7 @@ class Family extends GedcomRecord * * @return int */ - public function getNumberOfChildren() + public function getNumberOfChildren(): int { $nchi = count($this->getChildren()); foreach ($this->getFacts('NCHI') as $fact) { @@ -291,7 +291,7 @@ class Family extends GedcomRecord * * @return Fact */ - public function getMarriage() + public function getMarriage(): Fact { return $this->getFirstFact('MARR'); } @@ -316,7 +316,7 @@ class Family extends GedcomRecord * * @return int */ - public function getMarriageYear() + public function getMarriageYear(): int { return $this->getMarriageDate()->minimumDate()->y; } @@ -326,7 +326,7 @@ class Family extends GedcomRecord * * @return Place */ - public function getMarriagePlace() + public function getMarriagePlace(): Place { $marriage = $this->getMarriage(); @@ -338,7 +338,7 @@ class Family extends GedcomRecord * * @return Date[] */ - public function getAllMarriageDates() + public function getAllMarriageDates(): array { foreach (explode('|', WT_EVENTS_MARR) as $event) { if ($array = $this->getAllEventDates($event)) { @@ -354,7 +354,7 @@ class Family extends GedcomRecord * * @return Place[] */ - public function getAllMarriagePlaces() + public function getAllMarriagePlaces(): array { foreach (explode('|', WT_EVENTS_MARR) as $event) { $places = $this->getAllEventPlaces($event); @@ -371,7 +371,7 @@ class Family extends GedcomRecord * * @return string[][] */ - public function getAllNames() + public function getAllNames(): array { if (is_null($this->getAllNames)) { // Check the script used by each name, so we can match cyrillic with cyrillic, greek with greek, etc. @@ -449,7 +449,7 @@ class Family extends GedcomRecord * * @return string */ - public function formatListDetails() + public function formatListDetails(): string { return $this->formatFirstMajorFact(WT_EVENTS_MARR, 1) . diff --git a/app/File.php b/app/File.php index d0ba21b26d..586680682d 100644 --- a/app/File.php +++ b/app/File.php @@ -29,7 +29,7 @@ class File * * @return bool Was the file deleted */ - public static function delete($path) + public static function delete($path): bool { if (is_dir($path)) { $dir = opendir($path); diff --git a/app/FlashMessages.php b/app/FlashMessages.php index 1b7c216156..8994da8e5b 100644 --- a/app/FlashMessages.php +++ b/app/FlashMessages.php @@ -47,7 +47,7 @@ class FlashMessages * * @return stdClass[] */ - public static function getMessages() + public static function getMessages(): array { $messages = Session::get(self::FLASH_KEY, []); Session::forget(self::FLASH_KEY); diff --git a/app/FontAwesome.php b/app/FontAwesome.php index 31067544b2..67e6b33293 100644 --- a/app/FontAwesome.php +++ b/app/FontAwesome.php @@ -89,7 +89,7 @@ class FontAwesome extends Html * * @return string */ - public static function decorativeIcon($icon, $attributes = []) + public static function decorativeIcon($icon, $attributes = []): string { if (empty($attributes['class'])) { $attributes['class'] = self::ICONS[$icon]; @@ -113,7 +113,7 @@ class FontAwesome extends Html * * @return string */ - public static function semanticIcon($icon, $title, $attributes = []) + public static function semanticIcon($icon, $title, $attributes = []): string { $attributes['title'] = $title; @@ -129,7 +129,7 @@ class FontAwesome extends Html * * @return string */ - public static function linkIcon($icon, $title, $attributes = []) + public static function linkIcon($icon, $title, $attributes = []): string { $title = strip_tags($title); $attributes['aria-label'] = $title; diff --git a/app/Functions/Functions.php b/app/Functions/Functions.php index 9a08bd6187..707a674373 100644 --- a/app/Functions/Functions.php +++ b/app/Functions/Functions.php @@ -89,7 +89,7 @@ class Functions * * @return string the subrecord that was found or an empty string "" if not found. */ - public static function getSubRecord($level, $tag, $gedrec, $num = 1) + public static function getSubRecord($level, $tag, $gedrec, $num = 1): string { if (empty($gedrec)) { return ''; @@ -131,7 +131,7 @@ class Functions * * @return string a string with all CONT lines merged */ - public static function getCont($nlevel, $nrec) + public static function getCont($nlevel, $nrec): string { $text = ''; @@ -214,7 +214,7 @@ class Functions * * @return string */ - public static function getCloseRelationshipName(Individual $individual1, Individual $individual2) + public static function getCloseRelationshipName(Individual $individual1, Individual $individual2): string { if ($individual1 === $individual2) { $label = self::reflexivePronoun($individual1); @@ -385,7 +385,7 @@ class Functions * * @return string */ - public static function getRelationshipName($nodes) + public static function getRelationshipName($nodes): string { if (!is_array($nodes)) { return ''; @@ -642,7 +642,7 @@ class Functions * * @return string */ - public static function getRelationshipNameFromPath($path, Individual $person1 = null, Individual $person2 = null) + public static function getRelationshipNameFromPath($path, Individual $person1 = null, Individual $person2 = null): string { if (!preg_match('/^(mot|fat|par|hus|wif|spo|son|dau|chi|bro|sis|sib)*$/', $path)) { return '<span class="error">' . $path . '</span>'; @@ -2198,7 +2198,7 @@ class Functions * * @return string */ - public static function getQueryUrl($overwrite = null, $separator = '&') + public static function getQueryUrl($overwrite = null, $separator = '&'): string { if (empty($_GET)) { $get = []; diff --git a/app/Functions/FunctionsCharts.php b/app/Functions/FunctionsCharts.php index 99b7780ab2..ed0156812c 100644 --- a/app/Functions/FunctionsCharts.php +++ b/app/Functions/FunctionsCharts.php @@ -436,7 +436,7 @@ class FunctionsCharts * * @return string */ - public static function getSosaName($sosa) + public static function getSosaName($sosa): string { $path = ''; while ($sosa > 1) { diff --git a/app/Functions/FunctionsDate.php b/app/Functions/FunctionsDate.php index 26e38698b1..141bde0da6 100644 --- a/app/Functions/FunctionsDate.php +++ b/app/Functions/FunctionsDate.php @@ -70,7 +70,7 @@ class FunctionsDate * * @return string */ - public static function formatTimestamp($time) + public static function formatTimestamp($time): string { $time_fmt = I18N::timeFormat(); // PHP::date() doesn't do I18N. Do it ourselves.... @@ -124,7 +124,7 @@ class FunctionsDate * * @return Date */ - public static function timestampToGedcomDate($time) + public static function timestampToGedcomDate($time): Date { return new Date(strtoupper(gmdate('j M Y', $time))); } diff --git a/app/Functions/FunctionsDb.php b/app/Functions/FunctionsDb.php index 61bf3c5356..a0463f95d1 100644 --- a/app/Functions/FunctionsDb.php +++ b/app/Functions/FunctionsDb.php @@ -45,7 +45,7 @@ class FunctionsDb * * @return string[] */ - public static function fetchAllLinks($xref, $gedcom_id) + public static function fetchAllLinks($xref, $gedcom_id): array { return Database::prepare( diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php index 9e662e4b3f..74aba6d141 100644 --- a/app/Functions/FunctionsEdit.php +++ b/app/Functions/FunctionsEdit.php @@ -61,7 +61,7 @@ class FunctionsEdit * * @return string */ - public static function editLanguageCheckboxes($parameter_name, $accepted_languages) + public static function editLanguageCheckboxes($parameter_name, $accepted_languages): string { $html = ''; foreach (I18N::activeLocales() as $locale) { @@ -82,7 +82,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsAccessLevels() + public static function optionsAccessLevels(): array { return [ Auth::PRIV_PRIVATE => I18N::translate('Show to visitors'), @@ -97,7 +97,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsActiveLanguages() + public static function optionsActiveLanguages(): array { $languages = []; foreach (I18N::activeLocales() as $locale) { @@ -112,7 +112,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsCalendarConversions() + public static function optionsCalendarConversions(): array { return ['none' => I18N::translate('No calendar conversion')] + Date::calendarNames(); } @@ -122,7 +122,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsContactMethods() + public static function optionsContactMethods(): array { return [ 'messaging' => I18N::translate('Internal messaging'), @@ -138,7 +138,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsHideShow() + public static function optionsHideShow(): array { return [ '0' => I18N::translate('no'), @@ -151,7 +151,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsInstalledLanguages() + public static function optionsInstalledLanguages(): array { $languages = []; foreach (I18N::installedLocales() as $locale) { @@ -168,7 +168,7 @@ class FunctionsEdit * * @return string[] */ - public static function numericOptions($integers) + public static function numericOptions($integers): array { $array = []; foreach ($integers as $integer) { @@ -187,7 +187,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsNoYes() + public static function optionsNoYes(): array { return [ '0' => I18N::translate('no'), @@ -202,7 +202,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsRelationships($relationship) + public static function optionsRelationships($relationship): array { $relationships = GedcomCodeRela::getValues(); // The user is allowed to specify values that aren't in the list. @@ -220,7 +220,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsRestrictions($include_empty) + public static function optionsRestrictions($include_empty): array { $options = [ 'none' => I18N::translate('Show to visitors'), @@ -242,7 +242,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsMailTransports() + public static function optionsMailTransports(): array { return [ 'internal' => I18N::translate('Use PHP mail to send messages'), @@ -255,7 +255,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsTemples() + public static function optionsTemples(): array { return ['' => I18N::translate('No temple - living ordinance')] + GedcomCodeTemp::templeNames(); } @@ -265,7 +265,7 @@ class FunctionsEdit * * @return string[] */ - public static function optionsUsers() + public static function optionsUsers(): array { $options = ['' => '-']; @@ -285,7 +285,7 @@ class FunctionsEdit * * @return string */ - public static function formControlFamily(Tree $tree, Family $family = null, array $attributes = []) + public static function formControlFamily(Tree $tree, Family $family = null, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -306,7 +306,7 @@ class FunctionsEdit * * @return string */ - public static function formControlFlag($flag, array $attributes = []) + public static function formControlFlag($flag, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -328,7 +328,7 @@ class FunctionsEdit * * @return string */ - public static function formControlIndividual(Tree $tree, Individual $individual = null, array $attributes = []) + public static function formControlIndividual(Tree $tree, Individual $individual = null, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -350,7 +350,7 @@ class FunctionsEdit * * @return string */ - public static function formControlMediaObject(Tree $tree, Media $media = null, array $attributes = []) + public static function formControlMediaObject(Tree $tree, Media $media = null, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -372,7 +372,7 @@ class FunctionsEdit * * @return string */ - public static function formControlNote(Tree $tree, Note $note = null, array $attributes = []) + public static function formControlNote(Tree $tree, Note $note = null, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -394,7 +394,7 @@ class FunctionsEdit * * @return string */ - public static function formControlPlace(Tree $tree, $place, array $attributes = []) + public static function formControlPlace(Tree $tree, $place, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -415,7 +415,7 @@ class FunctionsEdit * * @return string */ - public static function formControlRepository(Tree $tree, Repository $repository = null, array $attributes = []) + public static function formControlRepository(Tree $tree, Repository $repository = null, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -437,7 +437,7 @@ class FunctionsEdit * * @return string */ - public static function formControlSource(Tree $tree, Source $source = null, array $attributes = []) + public static function formControlSource(Tree $tree, Source $source = null, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -459,7 +459,7 @@ class FunctionsEdit * * @return string */ - public static function formControlSubmitter(Tree $tree, GedcomRecord $submitter = null, array $attributes = []) + public static function formControlSubmitter(Tree $tree, GedcomRecord $submitter = null, array $attributes = []): string { $value = ''; $options = ['' => '']; @@ -492,7 +492,7 @@ class FunctionsEdit * * @return string */ - public static function addSimpleTag(Tree $tree, $tag, $upperlevel = '', $label = '', $extra = null, Individual $person = null) + public static function addSimpleTag(Tree $tree, $tag, $upperlevel = '', $label = '', $extra = null, Individual $person = null): string { // @TODO $xref is no longer set (from edit_interface). global $request; diff --git a/app/Functions/FunctionsExport.php b/app/Functions/FunctionsExport.php index 70b4d61530..57325daf5d 100644 --- a/app/Functions/FunctionsExport.php +++ b/app/Functions/FunctionsExport.php @@ -40,7 +40,7 @@ class FunctionsExport * * @return string */ - public static function reformatRecord($rec) + public static function reformatRecord($rec): string { $newrec = ''; foreach (preg_split('/[\r\n]+/', $rec, -1, PREG_SPLIT_NO_EMPTY) as $line) { @@ -80,7 +80,7 @@ class FunctionsExport * * @return string */ - public static function gedcomHeader(Tree $tree) + public static function gedcomHeader(Tree $tree): string { // Default values for a new header $HEAD = '0 HEAD'; @@ -142,7 +142,7 @@ class FunctionsExport * * @return string */ - public static function convertMediaPath($rec, $path) + public static function convertMediaPath($rec, $path): string { if ($path && preg_match('/\n1 FILE (.+)/', $rec, $match)) { $old_file_name = $match[1]; diff --git a/app/Functions/FunctionsImport.php b/app/Functions/FunctionsImport.php index bb3328c6dd..e26b80bd18 100644 --- a/app/Functions/FunctionsImport.php +++ b/app/Functions/FunctionsImport.php @@ -44,7 +44,7 @@ class FunctionsImport * * @return string */ - public static function reformatRecord($rec, Tree $tree) + public static function reformatRecord($rec, Tree $tree): string { // Strip out mac/msdos line endings $rec = preg_replace("/[\r\n]+/", "\n", $rec); @@ -1048,7 +1048,7 @@ class FunctionsImport * * @return string */ - public static function convertInlineMedia(Tree $tree, $gedrec) + public static function convertInlineMedia(Tree $tree, $gedrec): string { while (preg_match('/\n1 OBJE(?:\n[2-9].+)+/', $gedrec, $match)) { $gedrec = str_replace($match[0], self::createMediaObject(1, $match[0], $tree), $gedrec); @@ -1072,7 +1072,7 @@ class FunctionsImport * * @return string */ - public static function createMediaObject($level, $gedrec, Tree $tree) + public static function createMediaObject($level, $gedrec, Tree $tree): string { if (preg_match('/\n\d FILE (.+)/', $gedrec, $file_match)) { $file = $file_match[1]; diff --git a/app/Functions/FunctionsPrint.php b/app/Functions/FunctionsPrint.php index 273d916adf..5e923b2ee5 100644 --- a/app/Functions/FunctionsPrint.php +++ b/app/Functions/FunctionsPrint.php @@ -114,7 +114,7 @@ class FunctionsPrint * * @return string HTML */ - public static function printFactNotes(Tree $tree, $factrec, $level) + public static function printFactNotes(Tree $tree, $factrec, $level): string { $data = ''; $previous_spos = 0; @@ -157,7 +157,7 @@ class FunctionsPrint * * @return string */ - public static function helpLink($topic) + public static function helpLink($topic): string { return FontAwesome::linkIcon('help', I18N::translate('Help'), [ @@ -176,7 +176,7 @@ class FunctionsPrint * * @return string HTML */ - public static function formatParentsAges(Individual $person, Date $birth_date) + public static function formatParentsAges(Individual $person, Date $birth_date): string { $html = ''; $families = $person->getChildFamilies(); @@ -229,7 +229,7 @@ class FunctionsPrint * * @return string */ - public static function formatFactDate(Fact $event, GedcomRecord $record, $anchor, $time) + public static function formatFactDate(Fact $event, GedcomRecord $record, $anchor, $time): string { global $pid; @@ -367,7 +367,7 @@ class FunctionsPrint * * @return string HTML */ - public static function formatFactPlace(Fact $event, $anchor = false, $sub_records = false, $lds = false) + public static function formatFactPlace(Fact $event, $anchor = false, $sub_records = false, $lds = false): string { $tree = $event->getParent()->getTree(); @@ -450,7 +450,7 @@ class FunctionsPrint * * @return string[] */ - public static function checkFactUnique($uniquefacts, $recfacts, $type) + public static function checkFactUnique($uniquefacts, $recfacts, $type): array { foreach ($recfacts as $factarray) { $fact = false; @@ -607,7 +607,7 @@ class FunctionsPrint * * @return string */ - public static function getLdsSummary(Individual $individual) + public static function getLdsSummary(Individual $individual): string { $BAPL = $individual->getFacts('BAPL') ? 'B' : '_'; $ENDL = $individual->getFacts('ENDL') ? 'E' : '_'; diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index f42a042a28..109c4626e0 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -487,7 +487,7 @@ class FunctionsPrintFacts * * @return string */ - private static function formatAssociateRelationship(Fact $event) + private static function formatAssociateRelationship(Fact $event): string { $parent = $event->getParent(); // To whom is this record an assocate? @@ -564,7 +564,7 @@ class FunctionsPrintFacts * * @return string HTML text */ - public static function printFactSources(Tree $tree, $factrec, $level) + public static function printFactSources(Tree $tree, $factrec, $level): string { $data = ''; $nlevel = $level + 1; @@ -881,7 +881,7 @@ class FunctionsPrintFacts * * @return string */ - public static function printSourceStructure(Tree $tree, array $textSOUR) + public static function printSourceStructure(Tree $tree, array $textSOUR): string { $html = ''; @@ -928,7 +928,7 @@ class FunctionsPrintFacts * * @return string[] */ - public static function getSourceStructure($srec) + public static function getSourceStructure($srec): array { // Set up the output array $textSOUR = [ diff --git a/app/Functions/FunctionsPrintLists.php b/app/Functions/FunctionsPrintLists.php index 29e934ee14..61ef110884 100644 --- a/app/Functions/FunctionsPrintLists.php +++ b/app/Functions/FunctionsPrintLists.php @@ -33,7 +33,7 @@ class FunctionsPrintLists * * @return string */ - public static function surnameTagCloud($surnames, $route, $totals, Tree $tree) + public static function surnameTagCloud($surnames, $route, $totals, Tree $tree): string { $minimum = PHP_INT_MAX; $maximum = 1; diff --git a/app/Functions/FunctionsRtl.php b/app/Functions/FunctionsRtl.php index 26ab52a3ef..4c187d5ed9 100644 --- a/app/Functions/FunctionsRtl.php +++ b/app/Functions/FunctionsRtl.php @@ -71,7 +71,7 @@ class FunctionsRtl * * @return string The input string, with ‎ and ‏ stripped */ - public static function stripLrmRlm($inputText) + public static function stripLrmRlm($inputText): string { return str_replace([ self::UTF8_LRM, @@ -96,7 +96,7 @@ class FunctionsRtl * * @return string The string with all texts encapsulated as required */ - public static function spanLtrRtl($inputText) + public static function spanLtrRtl($inputText): string { if ($inputText == '') { // Nothing to do @@ -507,7 +507,7 @@ class FunctionsRtl * * @return string */ - public static function starredName($textSpan, $direction) + public static function starredName($textSpan, $direction): string { // To avoid a TCPDF bug that mixes up the word order, insert those <u> and </u> tags // only when page and span directions are identical. @@ -555,7 +555,7 @@ class FunctionsRtl * * @return array */ - public static function getChar($text, $offset) + public static function getChar($text, $offset): array { if ($text == '') { return [ @@ -1134,7 +1134,7 @@ class FunctionsRtl * * @return string */ - public static function utf8WordWrap($string, $width = 75, $sep = "\n", $cut = false) + public static function utf8WordWrap($string, $width = 75, $sep = "\n", $cut = false): string { $out = ''; while ($string) { diff --git a/app/GedcomCode/GedcomCodeAdop.php b/app/GedcomCode/GedcomCodeAdop.php index 9c0c5205d3..9ac7df6427 100644 --- a/app/GedcomCode/GedcomCodeAdop.php +++ b/app/GedcomCode/GedcomCodeAdop.php @@ -87,7 +87,7 @@ class GedcomCodeAdop * * @return string[] */ - public static function getValues(GedcomRecord $record = null) + public static function getValues(GedcomRecord $record = null): array { $values = []; foreach (self::$TYPES as $type) { diff --git a/app/GedcomCode/GedcomCodeName.php b/app/GedcomCode/GedcomCodeName.php index 751f0e8502..dfcc758e2e 100644 --- a/app/GedcomCode/GedcomCodeName.php +++ b/app/GedcomCode/GedcomCodeName.php @@ -167,7 +167,7 @@ class GedcomCodeName * * @return string[] */ - public static function getValues(GedcomRecord $record = null) + public static function getValues(GedcomRecord $record = null): array { $values = ['' => '']; foreach (self::$TYPES as $type) { diff --git a/app/GedcomCode/GedcomCodePedi.php b/app/GedcomCode/GedcomCodePedi.php index 003cbe5dce..7d72126a1b 100644 --- a/app/GedcomCode/GedcomCodePedi.php +++ b/app/GedcomCode/GedcomCodePedi.php @@ -107,7 +107,7 @@ class GedcomCodePedi * * @return string[] */ - public static function getValues(GedcomRecord $record = null) + public static function getValues(GedcomRecord $record = null): array { $values = ['' => '']; foreach (self::$TYPES as $type) { diff --git a/app/GedcomCode/GedcomCodeQuay.php b/app/GedcomCode/GedcomCodeQuay.php index af7d6cac81..4eb0762e02 100644 --- a/app/GedcomCode/GedcomCodeQuay.php +++ b/app/GedcomCode/GedcomCodeQuay.php @@ -62,7 +62,7 @@ class GedcomCodeQuay * * @return string[] */ - public static function getValues() + public static function getValues(): array { $values = []; foreach (self::$TYPES as $type) { diff --git a/app/GedcomCode/GedcomCodeRela.php b/app/GedcomCode/GedcomCodeRela.php index 58b5924720..ce2b613a7f 100644 --- a/app/GedcomCode/GedcomCodeRela.php +++ b/app/GedcomCode/GedcomCodeRela.php @@ -305,7 +305,7 @@ class GedcomCodeRela * * @return string[] */ - public static function getValues(GedcomRecord $record = null) + public static function getValues(GedcomRecord $record = null): array { $values = []; foreach (self::$TYPES as $type) { diff --git a/app/GedcomCode/GedcomCodeStat.php b/app/GedcomCode/GedcomCodeStat.php index acf952519e..f1aec4ed32 100644 --- a/app/GedcomCode/GedcomCodeStat.php +++ b/app/GedcomCode/GedcomCodeStat.php @@ -147,7 +147,7 @@ class GedcomCodeStat * * @return string[] */ - public static function statusNames($tag) + public static function statusNames($tag): array { $status_names = []; foreach (self::statusCodes($tag) as $status_code) { diff --git a/app/GedcomCode/GedcomCodeTemp.php b/app/GedcomCode/GedcomCodeTemp.php index d7f239098d..5783647542 100644 --- a/app/GedcomCode/GedcomCodeTemp.php +++ b/app/GedcomCode/GedcomCodeTemp.php @@ -29,7 +29,7 @@ class GedcomCodeTemp * * @return bool */ - public static function isTagLDS($tag) + public static function isTagLDS($tag): bool { return $tag === 'BAPL' || $tag === 'CONL' || $tag === 'ENDL' || $tag === 'SLGC' || $tag === 'SLGS'; } @@ -45,7 +45,7 @@ class GedcomCodeTemp * * @return string[] */ - public static function templeCodes() + public static function templeCodes(): array { return [ 'ABA', @@ -691,7 +691,7 @@ class GedcomCodeTemp * * @return string[] */ - public static function templeNames() + public static function templeNames(): array { $temple_names = []; foreach (self::templeCodes() as $temple_code) { diff --git a/app/GedcomRecord.php b/app/GedcomRecord.php index 90841d5426..d1f5639a08 100644 --- a/app/GedcomRecord.php +++ b/app/GedcomRecord.php @@ -277,7 +277,7 @@ class GedcomRecord * * @return string */ - public function getXref() + public function getXref(): string { return $this->xref; } @@ -287,7 +287,7 @@ class GedcomRecord * * @return Tree */ - public function getTree() + public function getTree(): Tree { return $this->tree; } @@ -312,7 +312,7 @@ class GedcomRecord * * @return bool */ - public function isPendingAddition() + public function isPendingAddition(): bool { return $this->pending !== null; } @@ -322,7 +322,7 @@ class GedcomRecord * * @return bool */ - public function isPendingDeletion() + public function isPendingDeletion(): bool { return $this->pending === ''; } @@ -334,7 +334,7 @@ class GedcomRecord * * @return string */ - public function getHtmlUrl() + public function getHtmlUrl(): string { return e($this->url()); } @@ -346,7 +346,7 @@ class GedcomRecord * * @return string */ - public function getRawUrl() + public function getRawUrl(): string { return $this->url(); } @@ -356,7 +356,7 @@ class GedcomRecord * * @return string */ - public function url() + public function url(): string { return route(static::ROUTE_NAME, [ 'xref' => $this->getXref(), @@ -371,7 +371,7 @@ class GedcomRecord * * @return bool */ - private function canShowRecord($access_level) + private function canShowRecord($access_level): bool { // This setting would better be called "$ENABLE_PRIVACY" if (!$this->tree->getPreference('HIDE_LIVE_PEOPLE')) { @@ -480,7 +480,7 @@ class GedcomRecord * * @return bool */ - public function canShowName($access_level = null) + public function canShowName($access_level = null): bool { if ($access_level === null) { $access_level = Auth::accessLevel($this->tree); @@ -494,7 +494,7 @@ class GedcomRecord * * @return bool */ - public function canEdit() + public function canEdit(): bool { return Auth::isManager($this->tree) || Auth::isEditor($this->tree) && strpos($this->gedcom, "\n1 RESN locked") === false; } @@ -538,7 +538,7 @@ class GedcomRecord * * @return string */ - protected function createPrivateGedcomRecord($access_level) + protected function createPrivateGedcomRecord($access_level): string { return '0 @' . $this->xref . '@ ' . static::RECORD_TYPE . "\n1 NOTE " . I18N::translate('Private'); } @@ -614,7 +614,7 @@ class GedcomRecord * * @return string[][] */ - public function getAllNames() + public function getAllNames(): array { if ($this->getAllNames === null) { $this->getAllNames = []; @@ -638,7 +638,7 @@ class GedcomRecord * * @return string */ - public function getFallBackName() + public function getFallBackName(): string { return e($this->getXref()); } @@ -648,7 +648,7 @@ class GedcomRecord * * @return int */ - public function getPrimaryName() + public function getPrimaryName(): int { static $language_script; @@ -676,7 +676,7 @@ class GedcomRecord * * @return int */ - public function getSecondaryName() + public function getSecondaryName(): int { if (is_null($this->getSecondaryName)) { // Generally, the primary and secondary names are the same @@ -765,7 +765,7 @@ class GedcomRecord * * @return string */ - public function getSortName() + public function getSortName(): string { // The sortable name is never displayed, no need to call canShowName() $tmp = $this->getAllNames(); @@ -794,7 +794,7 @@ class GedcomRecord * * @return string */ - public function formatList() + public function formatList(): string { $html = '<a href="' . e($this->url()) . '" class="list_item">'; $html .= '<b>' . $this->getFullName() . '</b>'; @@ -810,7 +810,7 @@ class GedcomRecord * * @return string */ - public function formatListDetails() + public function formatListDetails(): string { return ''; } @@ -823,7 +823,7 @@ class GedcomRecord * * @return string */ - public function formatFirstMajorFact($facts, $style) + public function formatFirstMajorFact($facts, $style): string { foreach ($this->getFacts($facts, true) as $event) { // Only display if it has a date or place (or both) @@ -852,7 +852,7 @@ class GedcomRecord * * @return Individual[] */ - public function linkedIndividuals($link) + public function linkedIndividuals($link): array { $rows = Database::prepare( "SELECT i_id AS xref, i_gedcom AS gedcom" . @@ -886,7 +886,7 @@ class GedcomRecord * * @return Family[] */ - public function linkedFamilies($link) + public function linkedFamilies($link): array { $rows = Database::prepare( "SELECT f_id AS xref, f_gedcom AS gedcom" . @@ -918,7 +918,7 @@ class GedcomRecord * * @return Source[] */ - public function linkedSources($link) + public function linkedSources($link): array { $rows = Database::prepare( "SELECT s_id AS xref, s_gedcom AS gedcom" . @@ -951,7 +951,7 @@ class GedcomRecord * * @return Media[] */ - public function linkedMedia($link) + public function linkedMedia($link): array { $rows = Database::prepare( "SELECT m_id AS xref, m_gedcom AS gedcom" . @@ -982,7 +982,7 @@ class GedcomRecord * * @return Note[] */ - public function linkedNotes($link) + public function linkedNotes($link): array { $rows = Database::prepare( "SELECT o_id AS xref, o_gedcom AS gedcom" . @@ -1016,7 +1016,7 @@ class GedcomRecord * * @return Repository[] */ - public function linkedRepositories($link) + public function linkedRepositories($link): array { $rows = Database::prepare( "SELECT o_id AS xref, o_gedcom AS gedcom" . @@ -1054,7 +1054,7 @@ class GedcomRecord * * @return Date[] */ - public function getAllEventDates($event_type) + public function getAllEventDates($event_type): array { $dates = []; foreach ($this->getFacts($event_type) as $event) { @@ -1073,7 +1073,7 @@ class GedcomRecord * * @return Place[] */ - public function getAllEventPlaces($event_type) + public function getAllEventPlaces($event_type): array { $places = []; foreach ($this->getFacts($event_type) as $event) { @@ -1115,7 +1115,7 @@ class GedcomRecord * * @return Fact[] */ - public function getFacts($filter = null, $sort = false, $access_level = null, $override = false) + public function getFacts($filter = null, $sort = false, $access_level = null, $override = false): array { if ($access_level === null) { $access_level = Auth::accessLevel($this->tree); diff --git a/app/GedcomTag.php b/app/GedcomTag.php index ff0259831d..6e9b7015fa 100644 --- a/app/GedcomTag.php +++ b/app/GedcomTag.php @@ -432,7 +432,7 @@ class GedcomTag * * @return bool */ - public static function isTag($tag) + public static function isTag($tag): bool { return in_array($tag, self::$ALL_TAGS); } @@ -1980,7 +1980,7 @@ class GedcomTag * * @return string */ - public static function getLabelValue($tag, $value, GedcomRecord $record = null, $element = 'div') + public static function getLabelValue($tag, $value, GedcomRecord $record = null, $element = 'div'): string { return '<' . $element . ' class="fact_' . $tag . '">' . @@ -1996,7 +1996,7 @@ class GedcomTag * * @return string[] */ - public static function getPicklistFacts($fact_type) + public static function getPicklistFacts($fact_type): array { switch ($fact_type) { case 'INDI': @@ -2267,7 +2267,7 @@ class GedcomTag * * @return string[] */ - public static function getFileFormTypes() + public static function getFileFormTypes(): array { $values = []; foreach (self::$OBJE_FILE_FORM_TYPE as $type) { @@ -2287,7 +2287,7 @@ class GedcomTag * * @return string */ - public static function createUid() + public static function createUid(): string { $uid = str_replace('-', '', Uuid::uuid4()); diff --git a/app/Html.php b/app/Html.php index f2d86ae227..e0fffa3959 100644 --- a/app/Html.php +++ b/app/Html.php @@ -27,7 +27,7 @@ class Html * * @return string */ - public static function attributes(array $attributes) + public static function attributes(array $attributes): string { $html = []; foreach ($attributes as $key => $value) { @@ -49,7 +49,7 @@ class Html * * @return string */ - public static function url($path, array $data) + public static function url($path, array $data): string { $path = strtr($path, ' ', '%20'); @@ -63,7 +63,7 @@ class Html * * @return string */ - public static function filename($filename) + public static function filename($filename): string { return '<samp class="filename" dir="ltr">' . e($filename) . '</samp>'; } diff --git a/app/Http/Controllers/AbstractEditController.php b/app/Http/Controllers/AbstractEditController.php index 51ce710acc..7c71b01754 100644 --- a/app/Http/Controllers/AbstractEditController.php +++ b/app/Http/Controllers/AbstractEditController.php @@ -118,7 +118,7 @@ abstract class AbstractEditController extends AbstractBaseController * * @return string */ - protected function updateRest($inputRec, $levelOverride = 'no') + protected function updateRest($inputRec, $levelOverride = 'no'): string { if (count($this->tagRest) === 0) { return $inputRec; // No update required @@ -171,7 +171,7 @@ abstract class AbstractEditController extends AbstractBaseController * * @return string The updated gedcom record */ - protected function handleUpdates($newged, $levelOverride = 'no') + protected function handleUpdates($newged, $levelOverride = 'no'): string { if ($levelOverride === 'no' || count($this->glevels) === 0) { $levelAdjust = 0; @@ -295,7 +295,7 @@ abstract class AbstractEditController extends AbstractBaseController * * @return string */ - protected function updateSource($inputRec, $levelOverride = 'no') + protected function updateSource($inputRec, $levelOverride = 'no'): string { if (count($this->tagSOUR) === 0) { return $inputRec; // No update required @@ -350,7 +350,7 @@ abstract class AbstractEditController extends AbstractBaseController * * @return string */ - public static function addNewName(Request $request, Tree $tree) + public static function addNewName(Request $request, Tree $tree): string { $gedrec = "\n1 NAME " . $request->get('NAME', ''); diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 2a8390c668..3ea43cc22a 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -1322,7 +1322,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function deletedModuleNames() + private function deletedModuleNames(): array { $database_modules = Database::prepare("SELECT module_name FROM `##module`")->fetchOneColumn(); $disk_modules = Module::getInstalledModules('disabled'); @@ -1521,7 +1521,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function serverWarnings() + private function serverWarnings(): array { $php_support_url = 'https://secure.php.net/supported-versions.php'; $version_parts = explode('.', PHP_VERSION); @@ -1586,7 +1586,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function totalChanges() + private function totalChanges(): array { return Database::prepare("SELECT g.gedcom_id, COUNT(change_id) FROM `##gedcom` AS g LEFT JOIN `##change` AS c ON g.gedcom_id = c.gedcom_id AND status = 'pending' GROUP BY g.gedcom_id")->fetchAssoc(); } @@ -1596,7 +1596,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function totalFamilies() + private function totalFamilies(): array { return Database::prepare("SELECT gedcom_id, COUNT(f_id) FROM `##gedcom` LEFT JOIN `##families` ON gedcom_id = f_file GROUP BY gedcom_id")->fetchAssoc(); } @@ -1606,7 +1606,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function totalIndividuals() + private function totalIndividuals(): array { return Database::prepare("SELECT gedcom_id, COUNT(i_id) FROM `##gedcom` LEFT JOIN `##individuals` ON gedcom_id = i_file GROUP BY gedcom_id")->fetchAssoc(); } @@ -1616,7 +1616,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function totalMediaObjects() + private function totalMediaObjects(): array { return Database::prepare("SELECT gedcom_id, COUNT(m_id) FROM `##gedcom` LEFT JOIN `##media` ON gedcom_id = m_file GROUP BY gedcom_id")->fetchAssoc(); } @@ -1626,7 +1626,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function totalNotes() + private function totalNotes(): array { return Database::prepare("SELECT gedcom_id, COUNT(o_id) FROM `##gedcom` LEFT JOIN `##other` ON gedcom_id = o_file AND o_type = 'NOTE' GROUP BY gedcom_id")->fetchAssoc(); } @@ -1636,7 +1636,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function totalRepositories() + private function totalRepositories(): array { return Database::prepare("SELECT gedcom_id, COUNT(o_id) FROM `##gedcom` LEFT JOIN `##other` ON gedcom_id = o_file AND o_type = 'REPO' GROUP BY gedcom_id")->fetchAssoc(); } @@ -1646,7 +1646,7 @@ class AdminController extends AbstractBaseController * * @return string[] */ - private function totalSources() + private function totalSources(): array { return Database::prepare("SELECT gedcom_id, COUNT(s_id) FROM `##gedcom` LEFT JOIN `##sources` ON gedcom_id = s_file GROUP BY gedcom_id")->fetchAssoc(); } diff --git a/app/Http/Controllers/AdminLocationController.php b/app/Http/Controllers/AdminLocationController.php index b94ca22f50..7abcabf972 100644 --- a/app/Http/Controllers/AdminLocationController.php +++ b/app/Http/Controllers/AdminLocationController.php @@ -676,7 +676,7 @@ class AdminLocationController extends AbstractBaseController * * @return array */ - private function gethierarchy($id) + private function gethierarchy($id): array { $statement = Database::prepare("SELECT pl_id, pl_parent_id, pl_place FROM `##placelocation` WHERE pl_id=:id"); $arr = []; @@ -699,7 +699,7 @@ class AdminLocationController extends AbstractBaseController * * @return stdClass[] */ - private function getPlaceListLocation($id) + private function getPlaceListLocation($id): array { $child_qry = Database::prepare( "SELECT COUNT(*) AS child_count, SUM(" . diff --git a/app/Http/Controllers/AdminMediaController.php b/app/Http/Controllers/AdminMediaController.php index 6d2f460d1c..d3e452707c 100644 --- a/app/Http/Controllers/AdminMediaController.php +++ b/app/Http/Controllers/AdminMediaController.php @@ -694,7 +694,7 @@ class AdminMediaController extends AbstractBaseController * * @return string HTML */ - private function mediaObjectInfo(Media $media) + private function mediaObjectInfo(Media $media): string { $html = '<b><a href="' . e($media->url()) . '">' . $media->getFullName() . '</a></b>' . '<br><i>' . e($media->getNote()) . '</i></br><br>'; diff --git a/app/Http/Controllers/AdminSiteController.php b/app/Http/Controllers/AdminSiteController.php index f3e9e9cb2a..dc452f8cb2 100644 --- a/app/Http/Controllers/AdminSiteController.php +++ b/app/Http/Controllers/AdminSiteController.php @@ -644,7 +644,7 @@ class AdminSiteController extends AbstractBaseController * * @return string[] */ - private function mailSslOptions() + private function mailSslOptions(): array { return [ 'none' => I18N::translate('none'), @@ -660,7 +660,7 @@ class AdminSiteController extends AbstractBaseController * * @return string[] */ - private function mailTransportOptions() + private function mailTransportOptions(): array { $options = [ 'internal' => I18N::translate('Use PHP mail to send messages'), @@ -681,7 +681,7 @@ class AdminSiteController extends AbstractBaseController * * @return string[] */ - private function registrationTextOptions() + private function registrationTextOptions(): array { return [ 0 => I18N::translate('No predefined text'), diff --git a/app/Http/Controllers/AdminTreesController.php b/app/Http/Controllers/AdminTreesController.php index 7544d86ea7..3bd55f476c 100644 --- a/app/Http/Controllers/AdminTreesController.php +++ b/app/Http/Controllers/AdminTreesController.php @@ -274,7 +274,7 @@ class AdminTreesController extends AbstractBaseController * * @return string */ - private function checkLinkMessage(Tree $tree, $type1, $xref1, $type2, $xref2) + private function checkLinkMessage(Tree $tree, $type1, $xref1, $type2, $xref2): string { /* I18N: The placeholders are GEDCOM XREFs and tags. e.g. “INDI I123 contains a FAMC link to F234.” */ return I18N::translate( @@ -295,7 +295,7 @@ class AdminTreesController extends AbstractBaseController * * @return string */ - private function checkLink(Tree $tree, string $xref) + private function checkLink(Tree $tree, string $xref): string { return '<b><a href="' . e(route('record', [ 'xref' => $xref, @@ -310,7 +310,7 @@ class AdminTreesController extends AbstractBaseController * * @return string */ - private function formatType($type) + private function formatType($type): string { return '<b title="' . GedcomTag::getLabel($type) . '">' . $type . '</b>'; } diff --git a/app/Http/Controllers/BranchesController.php b/app/Http/Controllers/BranchesController.php index d9f8bc9223..f0a45ac53c 100644 --- a/app/Http/Controllers/BranchesController.php +++ b/app/Http/Controllers/BranchesController.php @@ -338,7 +338,7 @@ class BranchesController extends AbstractBaseController * * @return string */ - private static function sosaGeneration($sosa) + private static function sosaGeneration($sosa): string { $generation = (int)log($sosa, 2) + 1; diff --git a/app/Http/Controllers/EditGedcomRecordController.php b/app/Http/Controllers/EditGedcomRecordController.php index 79a43910d6..79a71993f1 100644 --- a/app/Http/Controllers/EditGedcomRecordController.php +++ b/app/Http/Controllers/EditGedcomRecordController.php @@ -501,7 +501,7 @@ class EditGedcomRecordController extends AbstractEditController * * @return string */ - private function removeLinks($gedrec, $xref) + private function removeLinks($gedrec, $xref): string { $gedrec = preg_replace('/\n1 ' . WT_REGEX_TAG . ' @' . $xref . '@(\n[2-9].*)*/', '', $gedrec); $gedrec = preg_replace('/\n2 ' . WT_REGEX_TAG . ' @' . $xref . '@(\n[3-9].*)*/', '', $gedrec); diff --git a/app/Http/Controllers/FamilyBookChartController.php b/app/Http/Controllers/FamilyBookChartController.php index c4f6851ad0..9b2e89d74f 100644 --- a/app/Http/Controllers/FamilyBookChartController.php +++ b/app/Http/Controllers/FamilyBookChartController.php @@ -159,7 +159,7 @@ class FamilyBookChartController extends AbstractChartController * * @return int */ - private function printDescendency(Individual $person = null, $generation) + private function printDescendency(Individual $person = null, $generation): int { if ($generation > $this->dgenerations) { return 0; @@ -398,7 +398,7 @@ class FamilyBookChartController extends AbstractChartController * * @return int */ - private function maxDescendencyGenerations(Individual $individual, $depth) + private function maxDescendencyGenerations(Individual $individual, $depth): int { if ($depth > $this->generations) { return $depth; diff --git a/app/Http/Controllers/FamilyController.php b/app/Http/Controllers/FamilyController.php index 4d170a7ba1..3efb2e8b8e 100644 --- a/app/Http/Controllers/FamilyController.php +++ b/app/Http/Controllers/FamilyController.php @@ -60,7 +60,7 @@ class FamilyController extends AbstractBaseController * * @return stdClass */ - private function significant(Family $family) + private function significant(Family $family): stdClass { $significant = (object)[ 'family' => $family, diff --git a/app/Http/Controllers/HomePageController.php b/app/Http/Controllers/HomePageController.php index 16a85e3657..26ff137280 100644 --- a/app/Http/Controllers/HomePageController.php +++ b/app/Http/Controllers/HomePageController.php @@ -365,7 +365,7 @@ class HomePageController extends AbstractBaseController * * @return Response */ - public function userPage(Tree $tree, User $user) + public function userPage(Tree $tree, User $user): Response { $tree_id = $tree->getTreeId(); $user_id = $user->getUserId(); diff --git a/app/Http/Controllers/IndividualController.php b/app/Http/Controllers/IndividualController.php index e2caf1d691..84ac539f37 100644 --- a/app/Http/Controllers/IndividualController.php +++ b/app/Http/Controllers/IndividualController.php @@ -242,7 +242,7 @@ class IndividualController extends AbstractBaseController * * @return string */ - private function formatNameRecord(Tree $tree, $n, Fact $fact) + private function formatNameRecord(Tree $tree, $n, Fact $fact): string { $individual = $fact->getParent(); @@ -351,7 +351,7 @@ class IndividualController extends AbstractBaseController * * @return string */ - private function formatSexRecord(Fact $fact) + private function formatSexRecord(Fact $fact): string { $individual = $fact->getParent(); @@ -404,7 +404,7 @@ class IndividualController extends AbstractBaseController * * @return ModuleTabInterface[] */ - public function getSidebars(Individual $individual) + public function getSidebars(Individual $individual): array { $sidebars = Module::getActiveSidebars($individual->getTree()); @@ -421,7 +421,7 @@ class IndividualController extends AbstractBaseController * * @return ModuleTabInterface[] */ - public function getTabs(Individual $individual) + public function getTabs(Individual $individual): array { $tabs = Module::getActiveTabs($individual->getTree()); @@ -438,7 +438,7 @@ class IndividualController extends AbstractBaseController * * @return stdClass */ - private function significant(Individual $individual) + private function significant(Individual $individual): stdClass { $significant = (object)[ 'family' => null, diff --git a/app/Http/Controllers/ListController.php b/app/Http/Controllers/ListController.php index 3a1a1dde64..17040e76a1 100644 --- a/app/Http/Controllers/ListController.php +++ b/app/Http/Controllers/ListController.php @@ -486,7 +486,7 @@ class ListController extends AbstractBaseController * * @return string[] */ - private function allFolders(Tree $tree) + private function allFolders(Tree $tree): array { $folders = Database::prepare( "SELECT LEFT(multimedia_file_refn, CHAR_LENGTH(multimedia_file_refn) - CHAR_LENGTH(SUBSTRING_INDEX(multimedia_file_refn, '/', -1))) AS media_path" . @@ -678,7 +678,7 @@ class ListController extends AbstractBaseController * * @return string */ - private function getInitialSql($field, $letter) + private function getInitialSql($field, $letter): string { switch (WT_LOCALE) { case 'cs': @@ -742,7 +742,7 @@ class ListController extends AbstractBaseController * * @return int[] */ - private function surnameAlpha(Tree $tree, $marnm, $fams, $totals = true) + private function surnameAlpha(Tree $tree, $marnm, $fams, $totals = true): array { $alphas = []; @@ -819,7 +819,7 @@ class ListController extends AbstractBaseController * * @return int[] */ - private function givenAlpha(Tree $tree, $surn, $salpha, $marnm, $fams) + private function givenAlpha(Tree $tree, $surn, $salpha, $marnm, $fams): array { $alphas = []; @@ -902,7 +902,7 @@ class ListController extends AbstractBaseController * * @return array */ - private function surnames(Tree $tree, $surn, $salpha, $marnm, $fams) + private function surnames(Tree $tree, $surn, $salpha, $marnm, $fams): array { $sql = "SELECT UPPER(n_surn COLLATE :collate) AS n_surn, n_surname COLLATE utf8_bin AS n_surname, COUNT(*) AS total" . @@ -954,7 +954,7 @@ class ListController extends AbstractBaseController * * @return Individual[] */ - private function individuals(Tree $tree, $surn, $salpha, $galpha, $marnm, $fams) + private function individuals(Tree $tree, $surn, $salpha, $galpha, $marnm, $fams): array { $sql = "SELECT i_id AS xref, i_gedcom AS gedcom, n_full " . @@ -1023,7 +1023,7 @@ class ListController extends AbstractBaseController * * @return Family[] */ - private function families(Tree $tree, $surn, $salpha, $galpha, $marnm) + private function families(Tree $tree, $surn, $salpha, $galpha, $marnm): array { $list = []; foreach ($this->individuals($tree, $surn, $salpha, $galpha, $marnm, true) as $indi) { diff --git a/app/Http/Controllers/MessageController.php b/app/Http/Controllers/MessageController.php index 1cb608463e..e830b8264b 100644 --- a/app/Http/Controllers/MessageController.php +++ b/app/Http/Controllers/MessageController.php @@ -325,7 +325,7 @@ class MessageController extends AbstractBaseController * * @return User[] */ - private function validContacts(Tree $tree) + private function validContacts(Tree $tree): array { $contacts = [ User::find((int)$tree->getPreference('CONTACT_USER_ID')), diff --git a/app/Http/Controllers/PedigreeChartController.php b/app/Http/Controllers/PedigreeChartController.php index 79803056c6..6b44dd56b7 100644 --- a/app/Http/Controllers/PedigreeChartController.php +++ b/app/Http/Controllers/PedigreeChartController.php @@ -347,7 +347,7 @@ class PedigreeChartController extends AbstractChartController * * @return string */ - public function getMenu() + public function getMenu(): string { $families = $this->root->getSpouseFamilies(); $html = ''; @@ -411,7 +411,7 @@ class PedigreeChartController extends AbstractChartController * * @return string */ - public function gotoPreviousGen($index) + public function gotoPreviousGen($index): string { $html = ''; if ($this->chartHasAncestors) { diff --git a/app/Http/Controllers/PlaceHierarchyController.php b/app/Http/Controllers/PlaceHierarchyController.php index 16be7913f6..c5c1884999 100644 --- a/app/Http/Controllers/PlaceHierarchyController.php +++ b/app/Http/Controllers/PlaceHierarchyController.php @@ -111,7 +111,7 @@ class PlaceHierarchyController extends AbstractBaseController * @return array * @throws \Exception */ - private function getList(Tree $tree) + private function getList(Tree $tree): array { $list_places = Place::allPlaces($tree); $numfound = count($list_places); @@ -159,7 +159,7 @@ class PlaceHierarchyController extends AbstractBaseController * @return array * @throws \Exception */ - private function getEvents($tree, $place) + private function getEvents($tree, $place): array { $indilist = []; $famlist = []; @@ -195,7 +195,7 @@ class PlaceHierarchyController extends AbstractBaseController * * @return array */ - private function breadcrumbs($place) + private function breadcrumbs($place): array { $breadcrumbs = []; if (!$place->isEmpty()) { diff --git a/app/Http/Controllers/RelationshipsChartController.php b/app/Http/Controllers/RelationshipsChartController.php index 2c6d8cb9d2..8b8b3a37a1 100644 --- a/app/Http/Controllers/RelationshipsChartController.php +++ b/app/Http/Controllers/RelationshipsChartController.php @@ -229,7 +229,7 @@ class RelationshipsChartController extends AbstractChartController * * @return string[][] */ - private function calculateRelationships(Individual $individual1, Individual $individual2, $recursion, $ancestor = false) + private function calculateRelationships(Individual $individual1, Individual $individual2, $recursion, $ancestor = false): array { $rows = Database::prepare( "SELECT l_from, l_to FROM `##link` WHERE l_file = :tree_id AND l_type IN ('FAMS', 'FAMC')" @@ -315,7 +315,7 @@ class RelationshipsChartController extends AbstractChartController * * @return string[] */ - private function oldStyleRelationshipPath(Tree $tree, array $path) + private function oldStyleRelationshipPath(Tree $tree, array $path): array { $spouse_codes = [ 'M' => 'hus', @@ -376,7 +376,7 @@ class RelationshipsChartController extends AbstractChartController * * @return string[] */ - private function allAncestors($xref1, $xref2, $tree_id) + private function allAncestors($xref1, $xref2, $tree_id): array { $ancestors = [ $xref1, @@ -422,7 +422,7 @@ class RelationshipsChartController extends AbstractChartController * * @return string[] */ - private function excludeFamilies($xref1, $xref2, $tree_id) + private function excludeFamilies($xref1, $xref2, $tree_id): array { return Database::prepare( "SELECT l_to" . diff --git a/app/Http/Controllers/ReportEngineController.php b/app/Http/Controllers/ReportEngineController.php index 7de384bc43..340b462692 100644 --- a/app/Http/Controllers/ReportEngineController.php +++ b/app/Http/Controllers/ReportEngineController.php @@ -283,7 +283,7 @@ class ReportEngineController extends AbstractBaseController * * @return string[] */ - private function allReports(Tree $tree) + private function allReports(Tree $tree): array { $reports = []; diff --git a/app/I18N.php b/app/I18N.php index c61fc61c3e..08b509d287 100644 --- a/app/I18N.php +++ b/app/I18N.php @@ -231,7 +231,7 @@ class I18N * * @return LocaleInterface[] */ - public static function activeLocales() + public static function activeLocales(): array { $code_list = Site::getPreference('LANGUAGES'); @@ -282,7 +282,7 @@ class I18N * * @return string */ - public static function dateFormat() + public static function dateFormat(): string { /* I18N: This is the format string for full dates. See http://php.net/date for codes */ return self::$translator->translate('%j %F %Y'); @@ -302,8 +302,7 @@ class I18N 50, 100, -1, - ]) - { + ]): string { $length_options = Bootstrap4::select(FunctionsEdit::numericOptions($lengths), 10); return @@ -339,7 +338,7 @@ class I18N * * @return string */ - public static function digits($n) + public static function digits($n): string { return self::$locale->digits($n); } @@ -349,7 +348,7 @@ class I18N * * @return string "ltr" or "rtl" */ - public static function direction() + public static function direction(): string { return self::$locale->direction(); } @@ -359,7 +358,7 @@ class I18N * * @return int Sunday=0, Monday=1, etc. */ - public static function firstDay() + public static function firstDay(): int { return self::$locale->territory()->firstDay(); } @@ -434,7 +433,7 @@ class I18N * * @return string */ - public static function htmlAttributes() + public static function htmlAttributes(): string { return self::$locale->htmlAttributes(); } @@ -446,7 +445,7 @@ class I18N * * @return string $string */ - public static function init($code = '') + public static function init($code = ''): string { mb_internal_encoding('UTF-8'); @@ -558,7 +557,7 @@ class I18N * * @return LocaleInterface[] */ - public static function installedLocales() + public static function installedLocales(): array { $locales = []; foreach (glob(WT_ROOT . 'language/*.mo') as $file) { @@ -582,7 +581,7 @@ class I18N * * @return string */ - public static function languageName($locale) + public static function languageName($locale): string { return Locale::create($locale)->endonym(); } @@ -594,7 +593,7 @@ class I18N * * @return string */ - public static function languageScript($locale) + public static function languageScript($locale): string { return Locale::create($locale)->script()->code(); } @@ -612,7 +611,7 @@ class I18N * * @return string */ - public static function number($n, $precision = 0) + public static function number($n, $precision = 0): string { return self::$locale->number(round($n, $precision)); } @@ -630,7 +629,7 @@ class I18N * * @return string */ - public static function percentage($n, $precision = 0) + public static function percentage($n, $precision = 0): string { return self::$locale->percent(round($n, $precision + 2)); } @@ -644,7 +643,7 @@ class I18N * * @return string */ - public static function plural(...$args) + public static function plural(...$args): string { $args[0] = self::$translator->translatePlural($args[0], $args[1], (int) $args[2]); unset($args[1], $args[2]); @@ -666,7 +665,7 @@ class I18N * * @return string */ - public static function reverseText($text) + public static function reverseText($text): string { // Remove HTML markup - we can't display it and it is LTR. $text = strip_tags($text); @@ -744,7 +743,7 @@ class I18N * * @return string */ - public static function strtolower($string) + public static function strtolower($string): string { if (in_array(self::$locale->language()->code(), self::DOTLESS_I_LOCALES)) { $string = strtr($string, self::DOTLESS_I_TOLOWER); @@ -760,7 +759,7 @@ class I18N * * @return string */ - public static function strtoupper($string) + public static function strtoupper($string): string { if (in_array(self::$locale->language()->code(), self::DOTLESS_I_LOCALES)) { $string = strtr($string, self::DOTLESS_I_TOUPPER); @@ -776,7 +775,7 @@ class I18N * * @return string */ - public static function textScript($string) + public static function textScript($string): string { $string = strip_tags($string); // otherwise HTML tags show up as latin $string = html_entity_decode($string, ENT_QUOTES, 'UTF-8'); // otherwise HTML entities show up as latin @@ -866,7 +865,7 @@ class I18N * * @return string */ - public static function timeFormat() + public static function timeFormat(): string { /* I18N: This is the format string for the time-of-day. See http://php.net/date for codes */ return self::$translator->translate('%H:%i:%s'); @@ -880,7 +879,7 @@ class I18N * * @return string */ - public static function translate(...$args) + public static function translate(...$args): string { $args[0] = self::$translator->translate($args[0]); @@ -895,7 +894,7 @@ class I18N * * @return string */ - public static function translateContext(...$args) + public static function translateContext(...$args): string { $args[1] = self::$translator->translateContext($args[0], $args[1]); unset($args[0]); diff --git a/app/Individual.php b/app/Individual.php index 05944f5b42..126c2b67e9 100644 --- a/app/Individual.php +++ b/app/Individual.php @@ -102,7 +102,7 @@ class Individual extends GedcomRecord * * @return bool */ - public function canShowName($access_level = null) + public function canShowName($access_level = null): bool { if ($access_level === null) { $access_level = Auth::accessLevel($this->tree); @@ -118,7 +118,7 @@ class Individual extends GedcomRecord * * @return bool */ - protected function canShowByType($access_level) + protected function canShowByType($access_level): bool { // Dead people... if ($this->tree->getPreference('SHOW_DEAD_PEOPLE') >= $access_level && $this->isDead()) { @@ -168,7 +168,7 @@ class Individual extends GedcomRecord * * @return bool */ - private static function isRelated(Individual $target, $distance) + private static function isRelated(Individual $target, $distance): bool { static $cache = null; @@ -243,7 +243,7 @@ class Individual extends GedcomRecord * * @return string */ - protected function createPrivateGedcomRecord($access_level) + protected function createPrivateGedcomRecord($access_level): string { $SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS'); @@ -296,7 +296,7 @@ class Individual extends GedcomRecord * * @return int */ - public static function compareBirthDate(Individual $x, Individual $y) + public static function compareBirthDate(Individual $x, Individual $y): int { return Date::compare($x->getEstimatedBirthDate(), $y->getEstimatedBirthDate()); } @@ -309,7 +309,7 @@ class Individual extends GedcomRecord * * @return int */ - public static function compareDeathDate(Individual $x, Individual $y) + public static function compareDeathDate(Individual $x, Individual $y): int { return Date::compare($x->getEstimatedDeathDate(), $y->getEstimatedDeathDate()); } @@ -320,7 +320,7 @@ class Individual extends GedcomRecord * * @return bool */ - public function isDead() + public function isDead(): bool { $MAX_ALIVE_AGE = (int)$this->tree->getPreference('MAX_ALIVE_AGE'); @@ -443,7 +443,7 @@ class Individual extends GedcomRecord * * @return string */ - public function displayImage($width, $height, $fit, $attributes) + public function displayImage($width, $height, $fit, $attributes): string { $media_file = $this->findHighlightedMediaFile(); @@ -463,7 +463,7 @@ class Individual extends GedcomRecord * * @return Date */ - public function getBirthDate() + public function getBirthDate(): Date { foreach ($this->getAllBirthDates() as $date) { if ($date->isOK()) { @@ -479,7 +479,7 @@ class Individual extends GedcomRecord * * @return Place */ - public function getBirthPlace() + public function getBirthPlace(): Place { foreach ($this->getAllBirthPlaces() as $place) { if ($place) { @@ -495,7 +495,7 @@ class Individual extends GedcomRecord * * @return string the year of birth */ - public function getBirthYear() + public function getBirthYear(): string { return $this->getBirthDate()->minimumDate()->format('%Y'); } @@ -505,7 +505,7 @@ class Individual extends GedcomRecord * * @return Date */ - public function getDeathDate() + public function getDeathDate(): Date { foreach ($this->getAllDeathDates() as $date) { if ($date->isOK()) { @@ -521,7 +521,7 @@ class Individual extends GedcomRecord * * @return Place */ - public function getDeathPlace() + public function getDeathPlace(): Place { foreach ($this->getAllDeathPlaces() as $place) { if ($place) { @@ -537,7 +537,7 @@ class Individual extends GedcomRecord * * @return string the year of death */ - public function getDeathYear() + public function getDeathYear(): string { return $this->getDeathDate()->minimumDate()->format('%Y'); } @@ -550,7 +550,7 @@ class Individual extends GedcomRecord * * @return string */ - public function getLifeSpan() + public function getLifeSpan(): string { // Just the first part of the place name $birth_place = strip_tags($this->getBirthPlace()->getShortName()); @@ -573,7 +573,7 @@ class Individual extends GedcomRecord * * @return Date[] */ - public function getAllBirthDates() + public function getAllBirthDates(): array { foreach (explode('|', WT_EVENTS_BIRT) as $event) { $tmp = $this->getAllEventDates($event); @@ -590,7 +590,7 @@ class Individual extends GedcomRecord * * @return Place[] */ - public function getAllBirthPlaces() + public function getAllBirthPlaces(): array { foreach (explode('|', WT_EVENTS_BIRT) as $event) { $places = $this->getAllEventPlaces($event); @@ -607,7 +607,7 @@ class Individual extends GedcomRecord * * @return Date[] */ - public function getAllDeathDates() + public function getAllDeathDates(): array { foreach (explode('|', WT_EVENTS_DEAT) as $event) { $tmp = $this->getAllEventDates($event); @@ -624,7 +624,7 @@ class Individual extends GedcomRecord * * @return Place[] */ - public function getAllDeathPlaces() + public function getAllDeathPlaces(): array { foreach (explode('|', WT_EVENTS_DEAT) as $event) { $places = $this->getAllEventPlaces($event); @@ -641,7 +641,7 @@ class Individual extends GedcomRecord * * @return Date */ - public function getEstimatedBirthDate() + public function getEstimatedBirthDate(): Date { if (is_null($this->estimated_birth_date)) { foreach ($this->getAllBirthDates() as $date) { @@ -727,7 +727,7 @@ class Individual extends GedcomRecord * * @return Date */ - public function getEstimatedDeathDate() + public function getEstimatedDeathDate(): Date { if ($this->estimated_death_date === null) { foreach ($this->getAllDeathDates() as $date) { @@ -772,7 +772,7 @@ class Individual extends GedcomRecord * * @return string */ - public function getSexImage($size = 'small') + public function getSexImage($size = 'small'): string { return self::sexImage($this->getSex(), $size); } @@ -785,7 +785,7 @@ class Individual extends GedcomRecord * * @return string */ - public static function sexImage($sex, $size = 'small') + public static function sexImage($sex, $size = 'small'): string { return '<i class="icon-sex_' . strtolower($sex) . '_' . ($size == 'small' ? '9x9' : '15x15') . '"></i>'; } @@ -795,7 +795,7 @@ class Individual extends GedcomRecord * * @return string */ - public function getBoxStyle() + public function getBoxStyle(): string { $tmp = [ 'M' => '', @@ -813,7 +813,7 @@ class Individual extends GedcomRecord * * @return Family[] */ - public function getSpouseFamilies($access_level = null) + public function getSpouseFamilies($access_level = null): array { if ($access_level === null) { $access_level = Auth::accessLevel($this->tree); @@ -879,7 +879,7 @@ class Individual extends GedcomRecord * * @return Family[] */ - public function getChildFamilies($access_level = null) + public function getChildFamilies($access_level = null): array { if ($access_level === null) { $access_level = Auth::accessLevel($this->tree); @@ -952,7 +952,7 @@ class Individual extends GedcomRecord * * @return Family[] */ - public function getChildStepFamilies() + public function getChildStepFamilies(): array { $step_families = []; $families = $this->getChildFamilies(); @@ -983,7 +983,7 @@ class Individual extends GedcomRecord * * @return Family[] */ - public function getSpouseStepFamilies() + public function getSpouseStepFamilies(): array { $step_families = []; $families = $this->getSpouseFamilies(); @@ -1026,7 +1026,7 @@ class Individual extends GedcomRecord * * @return string */ - public function getStepFamilyLabel(Family $step_family) + public function getStepFamilyLabel(Family $step_family): string { foreach ($this->getChildFamilies() as $family) { if ($family !== $step_family) { @@ -1093,7 +1093,7 @@ class Individual extends GedcomRecord * * @return string a div block with father & mother names */ - public function getPrimaryParentsNames($classname = '', $display = '') + public function getPrimaryParentsNames($classname = '', $display = ''): string { $fam = $this->getPrimaryChildFamily(); if (!$fam) { @@ -1133,7 +1133,7 @@ class Individual extends GedcomRecord } /** {@inheritdoc} */ - public function getFallBackName() + public function getFallBackName(): string { return '@P.N. /@N.N./'; } @@ -1313,7 +1313,16 @@ class Individual extends GedcomRecord */ public function extractNames() { - $this->extractNamesFromFacts(1, 'NAME', $this->getFacts('NAME', false, Auth::accessLevel($this->tree), $this->canShowName())); + $this->extractNamesFromFacts( + 1, + 'NAME', + $this->getFacts( + 'NAME', + false, + Auth::accessLevel($this->tree), + $this->canShowName() + ) + ); } /** @@ -1322,7 +1331,7 @@ class Individual extends GedcomRecord * * @return string */ - public function formatListDetails() + public function formatListDetails(): string { return $this->formatFirstMajorFact(WT_EVENTS_BIRT, 1) . diff --git a/app/Location.php b/app/Location.php index f5d49e872d..eee703e2e0 100644 --- a/app/Location.php +++ b/app/Location.php @@ -66,7 +66,7 @@ class Location /** * @return bool */ - public function knownLatLon() + public function knownLatLon(): bool { return ($this->record->pl_lati && $this->record->pl_long); } @@ -116,7 +116,7 @@ class Location /** * @return array */ - public function getLatLonJSArray() + public function getLatLonJSArray(): array { return [ $this->getLat('signed'), @@ -129,7 +129,7 @@ class Location * * @return array */ - public function getGeoJsonCoords() + public function getGeoJsonCoords(): array { return [ $this->getLon('signed'), @@ -140,7 +140,7 @@ class Location /** * @return string */ - public function getId() + public function getId(): string { return $this->record->pl_id; } @@ -148,7 +148,7 @@ class Location /** * @return string */ - public function getLevel() + public function getLevel(): string { return $this->record->pl_level; } @@ -156,7 +156,7 @@ class Location /** * @return bool */ - public function isValid() + public function isValid(): bool { return $this->record->pl_id !== 0; } @@ -164,7 +164,7 @@ class Location /** * @return string */ - public function getPlace() + public function getPlace(): string { return $this->record->pl_place; } @@ -188,7 +188,7 @@ class Location /** * @return stdClass */ - public function getRecord() + public function getRecord(): stdClass { return $this->record; } diff --git a/app/Mail.php b/app/Mail.php index 445b142c29..4a36e86c02 100644 --- a/app/Mail.php +++ b/app/Mail.php @@ -43,7 +43,7 @@ class Mail * * @return bool */ - public static function send(User $from, User $to, User $reply_to, $subject, $message_text, $message_html) + public static function send(User $from, User $to, User $reply_to, $subject, $message_text, $message_html): bool { try { // Swiftmailer uses the PHP default tmp directory. On some servers, this diff --git a/app/Media.php b/app/Media.php index 24512a0cdf..bb3ac1469b 100644 --- a/app/Media.php +++ b/app/Media.php @@ -56,7 +56,7 @@ class Media extends GedcomRecord * * @return bool */ - protected function canShowByType($access_level) + protected function canShowByType($access_level): bool { // Hide media objects if they are attached to private records $linked_ids = Database::prepare( @@ -175,7 +175,7 @@ class Media extends GedcomRecord * * @return string */ - public function formatListDetails() + public function formatListDetails(): string { ob_start(); FunctionsPrintFacts::printMediaLinks($this->getTree(), '1 OBJE @' . $this->getXref() . '@', 1); @@ -193,7 +193,7 @@ class Media extends GedcomRecord * * @return string */ - public function displayImage($width, $height, $fit, $attributes = []) + public function displayImage($width, $height, $fit, $attributes = []): string { // Display the first image foreach ($this->mediaFiles() as $media_file) { diff --git a/app/MediaFile.php b/app/MediaFile.php index 2061cc7d5b..5b23a090dc 100644 --- a/app/MediaFile.php +++ b/app/MediaFile.php @@ -179,7 +179,7 @@ class MediaFile /** * @return bool */ - public function isPendingAddition() + public function isPendingAddition(): bool { foreach ($this->media->getFacts() as $fact) { if ($fact->getFactId() === $this->fact_id) { @@ -193,7 +193,7 @@ class MediaFile /** * @return bool */ - public function isPendingDeletion() + public function isPendingDeletion(): bool { foreach ($this->media->getFacts() as $fact) { if ($fact->getFactId() === $this->fact_id) { @@ -214,7 +214,7 @@ class MediaFile * * @return string */ - public function displayImage($width, $height, $fit, $attributes = []) + public function displayImage($width, $height, $fit, $attributes = []): string { if ($this->isExternal()) { $src = $this->multimedia_file_refn; @@ -284,7 +284,7 @@ class MediaFile * * @return bool */ - public function fileExists() + public function fileExists(): bool { return !$this->isExternal() && file_exists($this->folder() . $this->multimedia_file_refn); } @@ -339,7 +339,7 @@ class MediaFile * * @return string */ - public function fileSizeKB() + public function fileSizeKB(): string { $size = $this->fileSizeBytes(); $size = (int)(($size + 1023) / 1024); @@ -372,7 +372,7 @@ class MediaFile * * @return string */ - public function downloadUrl() + public function downloadUrl(): string { return route('media-download', [ 'xref' => $this->media->getXref(), @@ -390,7 +390,7 @@ class MediaFile * * @return string */ - public function imageUrl($width, $height, $fit) + public function imageUrl($width, $height, $fit): string { // Sign the URL, to protect against mass-resize attacks. $glide_key = Site::getPreference('glide-key'); @@ -446,7 +446,7 @@ class MediaFile * * @return string */ - public function mimeType() + public function mimeType(): string { return self::MIME_TYPES[$this->extension()] ?? 'application/octet-stream'; } diff --git a/app/Menu.php b/app/Menu.php index db8dd5a9dd..d00495c4c7 100644 --- a/app/Menu.php +++ b/app/Menu.php @@ -101,7 +101,7 @@ class Menu * * @return string[] */ - public function getAttrs() + public function getAttrs(): array { return $this->attrs; } @@ -113,7 +113,7 @@ class Menu * * @return $this */ - public function setAttrs(array $attrs) + public function setAttrs(array $attrs): self { $this->attrs = $attrs; @@ -125,7 +125,7 @@ class Menu * * @return string */ - public function getClass() + public function getClass(): string { return $this->class; } @@ -137,7 +137,7 @@ class Menu * * @return $this */ - public function setClass($class) + public function setClass($class): self { $this->class = $class; @@ -149,7 +149,7 @@ class Menu * * @return string */ - public function getLabel() + public function getLabel(): string { return $this->label; } @@ -161,7 +161,7 @@ class Menu * * @return $this */ - public function setLabel($label) + public function setLabel($label): self { $this->label = $label; @@ -173,7 +173,7 @@ class Menu * * @return string */ - public function getLink() + public function getLink(): string { return $this->link; } @@ -185,7 +185,7 @@ class Menu * * @return $this */ - public function setLink($link) + public function setLink($link): self { $this->link = $link; @@ -199,7 +199,7 @@ class Menu * * @return $this */ - public function addSubmenu($menu) + public function addSubmenu($menu): self { $this->submenus[] = $menu; @@ -211,7 +211,7 @@ class Menu * * @return string */ - public function getMenuAsList() + public function getMenuAsList(): string { $attrs = ''; foreach ($this->attrs as $key => $value) { @@ -239,7 +239,7 @@ class Menu * * @return Menu[] */ - public function getSubmenus() + public function getSubmenus(): array { return $this->submenus; } @@ -251,7 +251,7 @@ class Menu * * @return $this */ - public function setSubmenus(array $submenus) + public function setSubmenus(array $submenus): self { $this->submenus = $submenus; diff --git a/app/Module.php b/app/Module.php index 4258ce4cdf..96e88c5cac 100644 --- a/app/Module.php +++ b/app/Module.php @@ -140,7 +140,7 @@ class Module * * @return string[] */ - public static function getCoreModuleNames() + public static function getCoreModuleNames(): array { return [ 'GEDFact_assistant', @@ -222,7 +222,7 @@ class Module * * @return AbstractModule[] */ - private static function getActiveModules() + private static function getActiveModules(): array { /** @var AbstractModule[] - Only query the database once. */ static $modules; @@ -269,7 +269,7 @@ class Module * * @return ModuleBlockInterface[]|ModuleChartInterface[]|ModuleMenuInterface[]|ModuleReportInterface[]|ModuleSidebarInterface[]|ModuleTabInterface[]|ModuleThemeInterface[] */ - private static function getActiveModulesByComponent(Tree $tree, $component) + private static function getActiveModulesByComponent(Tree $tree, $component): array { $module_names = Database::prepare( "SELECT module_name" . @@ -312,7 +312,7 @@ class Module * * @return AbstractModule[] */ - public static function getAllModulesByComponent($component) + public static function getAllModulesByComponent($component): array { $module_names = Database::prepare( "SELECT module_name" . @@ -348,7 +348,7 @@ class Module * * @return ModuleBlockInterface[] */ - public static function getActiveBlocks(Tree $tree) + public static function getActiveBlocks(Tree $tree): array { return self::getActiveModulesByComponent($tree, 'block'); } @@ -360,7 +360,7 @@ class Module * * @return ModuleChartInterface[] */ - public static function getActiveCharts(Tree $tree) + public static function getActiveCharts(Tree $tree): array { return self::getActiveModulesByComponent($tree, 'chart'); } @@ -373,7 +373,7 @@ class Module * * @return bool */ - public static function isActiveChart(Tree $tree, $module) + public static function isActiveChart(Tree $tree, $module): bool { return array_key_exists($module, self::getActiveModulesByComponent($tree, 'chart')); } @@ -383,7 +383,7 @@ class Module * * @return ModuleConfigInterface[] */ - public static function configurableModules() + public static function configurableModules(): array { $modules = array_filter(self::getInstalledModules('disabled'), function (AbstractModule $module): bool { return $module instanceof ModuleConfigInterface; @@ -404,7 +404,7 @@ class Module * * @return ModuleMenuInterface[] */ - public static function getActiveMenus(Tree $tree) + public static function getActiveMenus(Tree $tree): array { return self::getActiveModulesByComponent($tree, 'menu'); } @@ -416,7 +416,7 @@ class Module * * @return ModuleReportInterface[] */ - public static function getActiveReports(Tree $tree) + public static function getActiveReports(Tree $tree): array { return self::getActiveModulesByComponent($tree, 'report'); } @@ -428,7 +428,7 @@ class Module * * @return ModuleSidebarInterface[] */ - public static function getActiveSidebars(Tree $tree) + public static function getActiveSidebars(Tree $tree): array { return self::getActiveModulesByComponent($tree, 'sidebar'); } @@ -440,7 +440,7 @@ class Module * * @return ModuleTabInterface[] */ - public static function getActiveTabs(Tree $tree) + public static function getActiveTabs(Tree $tree): array { return self::getActiveModulesByComponent($tree, 'tab'); } @@ -452,7 +452,7 @@ class Module * * @return ModuleThemeInterface[] */ - public static function getActiveThemes(Tree $tree) + public static function getActiveThemes(Tree $tree): array { return self::getActiveModulesByComponent($tree, 'theme'); } @@ -484,7 +484,7 @@ class Module * * @return AbstractModule[] */ - public static function getInstalledModules($default_status) + public static function getInstalledModules($default_status): array { $modules = []; diff --git a/app/Module/AbstractModule.php b/app/Module/AbstractModule.php index 9dd9633588..6b2633064d 100644 --- a/app/Module/AbstractModule.php +++ b/app/Module/AbstractModule.php @@ -58,7 +58,7 @@ abstract class AbstractModule * * @return string */ - public function getBlockSetting($block_id, $setting_name, $default_value = '') + public function getBlockSetting($block_id, $setting_name, $default_value = ''): string { $setting_value = Database::prepare( "SELECT setting_value FROM `##block_setting` WHERE block_id = :block_id AND setting_name = :setting_name" @@ -79,7 +79,7 @@ abstract class AbstractModule * * @return $this */ - public function setBlockSetting(int $block_id, string $setting_name, string $setting_value) + public function setBlockSetting(int $block_id, string $setting_name, string $setting_value): self { Database::prepare( "REPLACE INTO `##block_setting` (block_id, setting_name, setting_value) VALUES (:block_id, :setting_name, :setting_value)" @@ -97,14 +97,14 @@ abstract class AbstractModule * * @return string */ - abstract public function getTitle(); + abstract public function getTitle(): string; /** * A sentence describing what this module does. * * @return string */ - abstract public function getDescription(); + abstract public function getDescription(): string; /** * What is the default access level for this module? @@ -113,7 +113,7 @@ abstract class AbstractModule * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { // Returns one of: Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_USER, WT_PRIV_ADMIN return Auth::PRIV_PRIVATE; @@ -124,7 +124,7 @@ abstract class AbstractModule * * @return string */ - public function getName() + public function getName(): string { return basename($this->directory); } @@ -174,7 +174,7 @@ abstract class AbstractModule * * @return $this */ - public function setPreference($setting_name, $setting_value) + public function setPreference($setting_name, $setting_value): self { $this->loadAllSettings(); diff --git a/app/Module/AhnentafelReportModule.php b/app/Module/AhnentafelReportModule.php index 9e1b30147a..cec0b62169 100644 --- a/app/Module/AhnentafelReportModule.php +++ b/app/Module/AhnentafelReportModule.php @@ -30,7 +30,7 @@ class AhnentafelReportModule extends AbstractModule implements ModuleReportInter * * @return string */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -42,7 +42,7 @@ class AhnentafelReportModule extends AbstractModule implements ModuleReportInter * * @return string */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Ancestors” module */ @@ -56,7 +56,7 @@ class AhnentafelReportModule extends AbstractModule implements ModuleReportInter * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/AlbumModule.php b/app/Module/AlbumModule.php index a622f36cfd..2b8b65f248 100644 --- a/app/Module/AlbumModule.php +++ b/app/Module/AlbumModule.php @@ -32,7 +32,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Album'); @@ -43,7 +43,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Album” module */ return I18N::translate('An alternative to the “media” tab, and an enhanced image viewer.'); @@ -55,7 +55,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return int */ - public function defaultTabOrder() + public function defaultTabOrder(): int { return 60; } @@ -67,7 +67,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return bool */ - public function hasTabContent(Individual $individual) + public function hasTabContent(Individual $individual): bool { return $individual->canEdit() || $this->getMedia($individual); } @@ -80,7 +80,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return bool */ - public function isGrayedOut(Individual $individual) + public function isGrayedOut(Individual $individual): bool { return !$this->getMedia($individual); } @@ -92,7 +92,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return string */ - public function getTabContent(Individual $individual) + public function getTabContent(Individual $individual): string { return view('modules/lightbox/tab', [ 'media_list' => $this->getMedia($individual), @@ -106,7 +106,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return Media[] */ - private function getMedia(Individual $individual) + private function getMedia(Individual $individual): array { if ($this->media_list === null) { // Use facts from this individual and all their spouses @@ -150,7 +150,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface * * @return bool */ - public function canLoadAjax() + public function canLoadAjax(): bool { return false; } diff --git a/app/Module/AncestorsChartModule.php b/app/Module/AncestorsChartModule.php index c8540f83e7..e15cccca54 100644 --- a/app/Module/AncestorsChartModule.php +++ b/app/Module/AncestorsChartModule.php @@ -30,7 +30,7 @@ class AncestorsChartModule extends AbstractModule implements ModuleChartInterfac * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Ancestors'); @@ -41,7 +41,7 @@ class AncestorsChartModule extends AbstractModule implements ModuleChartInterfac * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “AncestorsChart” module */ return I18N::translate('A chart of an individual’s ancestors.'); @@ -54,7 +54,7 @@ class AncestorsChartModule extends AbstractModule implements ModuleChartInterfac * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/BatchUpdate/BatchUpdateBasePlugin.php b/app/Module/BatchUpdate/BatchUpdateBasePlugin.php index bcccb24931..f1c75480d6 100644 --- a/app/Module/BatchUpdate/BatchUpdateBasePlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateBasePlugin.php @@ -48,7 +48,7 @@ abstract class BatchUpdateBasePlugin * * @return string[] */ - public function getRecordTypesToUpdate() + public function getRecordTypesToUpdate(): array { return ['INDI']; } @@ -68,7 +68,7 @@ abstract class BatchUpdateBasePlugin * * @return string */ - public function getOptionsForm() + public function getOptionsForm(): string { return '<div class="row form-group">' . @@ -88,7 +88,7 @@ abstract class BatchUpdateBasePlugin * * @return string */ - public function getActionPreview(GedcomRecord $record) + public function getActionPreview(GedcomRecord $record): string { $old_lines = preg_split('/[\n]+/', $record->getGedcom()); $new_lines = preg_split('/[\n]+/', $this->updateRecord($record)); @@ -119,7 +119,7 @@ abstract class BatchUpdateBasePlugin * * @return string */ - public static function decorateInsertedText($text) + public static function decorateInsertedText($text): string { return '<ins>' . $text . '</ins>'; } @@ -131,7 +131,7 @@ abstract class BatchUpdateBasePlugin * * @return string */ - public static function decorateDeletedText($text) + public static function decorateDeletedText($text): string { return '<del>' . $text . '</del>'; } @@ -144,7 +144,7 @@ abstract class BatchUpdateBasePlugin * * @return string */ - public static function createEditLinks($gedrec, GedcomRecord $record) + public static function createEditLinks($gedrec, GedcomRecord $record): string { return preg_replace( "/@([^#@\n]+)@/m", diff --git a/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php b/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php index acd7be7eb7..c71e60a1a0 100644 --- a/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php @@ -28,7 +28,7 @@ class BatchUpdateDuplicateLinksPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getName() + public function getName(): string { return I18N::translate('Remove duplicate links'); } @@ -38,7 +38,7 @@ class BatchUpdateDuplicateLinksPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getDescription() + public function getDescription(): string { return I18N::translate('A common error is to have multiple links to the same record, for example listing the same child more than once in a family record.'); } @@ -48,7 +48,7 @@ class BatchUpdateDuplicateLinksPlugin extends BatchUpdateBasePlugin * * @return string[] */ - public function getRecordTypesToUpdate() + public function getRecordTypesToUpdate(): array { return [ 'INDI', diff --git a/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php b/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php index c91a507008..046eafbd75 100644 --- a/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php @@ -34,7 +34,7 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getName() + public function getName(): string { return I18N::translate('Add missing married names'); } @@ -44,7 +44,7 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getDescription() + public function getDescription(): string { return I18N::translate('You can make it easier to search for married women by recording their married name. However not all women take their husband’s surname, so beware of introducing incorrect information into your database.'); } @@ -177,7 +177,7 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getOptionsForm() + public function getOptionsForm(): string { return '<div class="row form-group">' . diff --git a/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php b/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php index 5269f7a831..44806ef710 100644 --- a/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php @@ -28,7 +28,7 @@ class BatchUpdateMissingDeathPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getName() + public function getName(): string { return I18N::translate('Add missing death records'); } @@ -38,7 +38,7 @@ class BatchUpdateMissingDeathPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getDescription() + public function getDescription(): string { return I18N::translate('You can speed up the privacy calculations by adding a death record to individuals whose death can be inferred from other dates, but who do not have a record of death, burial, cremation, etc.'); } diff --git a/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php b/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php index 010539d0f9..61a82b68d9 100644 --- a/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php @@ -28,7 +28,7 @@ class BatchUpdateNameFormatPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getName() + public function getName(): string { return I18N::translate('Fix name slashes and spaces'); } @@ -38,7 +38,7 @@ class BatchUpdateNameFormatPlugin extends BatchUpdateBasePlugin * * @return string */ - public function getDescription() + public function getDescription(): string { return I18N::translate('Correct NAME records of the form “John/DOE/” or “John /DOE”, as produced by older genealogy programs.'); } diff --git a/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php b/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php index 5ed42fe344..e1d1077494 100644 --- a/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php @@ -50,7 +50,7 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin * * @return string */ - public function getName() + public function getName(): string { return I18N::translate('Search and replace'); } @@ -60,7 +60,7 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Search and replace” option of the batch update module */ return I18N::translate('Search and replace text, using simple searches or advanced pattern matching.'); @@ -71,7 +71,7 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin * * @return string[] */ - public function getRecordTypesToUpdate() + public function getRecordTypesToUpdate(): array { return [ 'INDI', @@ -168,7 +168,7 @@ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin * * @return string */ - public function getOptionsForm() + public function getOptionsForm(): string { $descriptions = [ 'exact' => I18N::translate('Match the exact text, even if it occurs in the middle of a word.'), diff --git a/app/Module/BatchUpdateModule.php b/app/Module/BatchUpdateModule.php index 79cab180fa..5a8336a8c3 100644 --- a/app/Module/BatchUpdateModule.php +++ b/app/Module/BatchUpdateModule.php @@ -47,7 +47,7 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Batch update'); @@ -58,7 +58,7 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Batch update” module */ return I18N::translate('Apply automatic corrections to your genealogy data.'); @@ -326,7 +326,7 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface * * @return BatchUpdateBasePlugin[] */ - private function getPluginList() + private function getPluginList(): array { $plugins = []; @@ -380,7 +380,7 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface * * @return string */ - public function getConfigLink() + public function getConfigLink(): string { return route('module', [ 'module' => $this->getName(), diff --git a/app/Module/BirthDeathMarriageReportModule.php b/app/Module/BirthDeathMarriageReportModule.php index 599c4c4549..158343c337 100644 --- a/app/Module/BirthDeathMarriageReportModule.php +++ b/app/Module/BirthDeathMarriageReportModule.php @@ -30,7 +30,7 @@ class BirthDeathMarriageReportModule extends AbstractModule implements ModuleRep * * @return string */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report. “Vital records” are life events - birth/marriage/death */ @@ -42,7 +42,7 @@ class BirthDeathMarriageReportModule extends AbstractModule implements ModuleRep * * @return string */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Vital records” module. “Vital records” are life events - birth/marriage/death */ @@ -56,7 +56,7 @@ class BirthDeathMarriageReportModule extends AbstractModule implements ModuleRep * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/BirthReportModule.php b/app/Module/BirthReportModule.php index 40882df2bf..592d2933ec 100644 --- a/app/Module/BirthReportModule.php +++ b/app/Module/BirthReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class BirthReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class BirthReportModule extends AbstractModule implements ModuleReportInterface } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Births” module */ @@ -48,7 +48,7 @@ class BirthReportModule extends AbstractModule implements ModuleReportInterface * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/CemeteryReportModule.php b/app/Module/CemeteryReportModule.php index 4f16dbd397..e4a271173e 100644 --- a/app/Module/CemeteryReportModule.php +++ b/app/Module/CemeteryReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class CemeteryReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class CemeteryReportModule extends AbstractModule implements ModuleReportInterfa } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Cemeteries” module */ @@ -48,7 +48,7 @@ class CemeteryReportModule extends AbstractModule implements ModuleReportInterfa * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/CensusAssistantModule.php b/app/Module/CensusAssistantModule.php index 39b879f5d4..348b203854 100644 --- a/app/Module/CensusAssistantModule.php +++ b/app/Module/CensusAssistantModule.php @@ -29,14 +29,14 @@ use Symfony\Component\HttpFoundation\Response; class CensusAssistantModule extends AbstractModule { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Census assistant'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Census assistant” module */ return I18N::translate('An alternative way to enter census transcripts and link them to individuals.'); @@ -78,7 +78,7 @@ class CensusAssistantModule extends AbstractModule * * @return string */ - public function createCensusAssistant(Individual $individual) + public function createCensusAssistant(Individual $individual): string { return view('modules/census-assistant', [ 'individual' => $individual, @@ -94,7 +94,7 @@ class CensusAssistantModule extends AbstractModule * * @return string */ - public function updateCensusAssistant(Request $request, Individual $individual, $fact_id, $newged, $keep_chan) + public function updateCensusAssistant(Request $request, Individual $individual, $fact_id, $newged, $keep_chan): string { $ca_title = $request->get('ca_title', ''); $ca_place = $request->get('ca_place', ''); @@ -134,7 +134,7 @@ class CensusAssistantModule extends AbstractModule * * @return string */ - private function createNoteText(CensusInterface $census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes) + private function createNoteText(CensusInterface $census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes): string { $text = $ca_title . "\n" . $ca_citation . "\n" . $ca_place . "\n\n"; @@ -172,7 +172,7 @@ class CensusAssistantModule extends AbstractModule * * @return string */ - public static function censusTableHeader(CensusInterface $census) + public static function censusTableHeader(CensusInterface $census): string { $html = ''; foreach ($census->columns() as $column) { @@ -191,7 +191,7 @@ class CensusAssistantModule extends AbstractModule * * @return string */ - public static function censusTableEmptyRow(CensusInterface $census) + public static function censusTableEmptyRow(CensusInterface $census): string { return '<tr class="wt-census-assistant-row"><td hidden></td>' . str_repeat('<td class="wt-census-assistant-field"><input type="text" class="form-control wt-census-assistant-form-control"></td>', count($census->columns())) . '<td><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>'; } @@ -207,7 +207,7 @@ class CensusAssistantModule extends AbstractModule * * @return string */ - public static function censusTableRow(CensusInterface $census, Individual $individual, Individual $head) + public static function censusTableRow(CensusInterface $census, Individual $individual, Individual $head): string { $html = ''; foreach ($census->columns() as $column) { diff --git a/app/Module/ChangeReportModule.php b/app/Module/ChangeReportModule.php index 1e47368cd2..967c35f0e8 100644 --- a/app/Module/ChangeReportModule.php +++ b/app/Module/ChangeReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class ChangeReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class ChangeReportModule extends AbstractModule implements ModuleReportInterface } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Changes” module */ @@ -48,7 +48,7 @@ class ChangeReportModule extends AbstractModule implements ModuleReportInterface * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_USER; } diff --git a/app/Module/ChartsBlockModule.php b/app/Module/ChartsBlockModule.php index 8e1f85393a..0f9e8697e0 100644 --- a/app/Module/ChartsBlockModule.php +++ b/app/Module/ChartsBlockModule.php @@ -29,14 +29,14 @@ use Symfony\Component\HttpFoundation\Request; class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/block */ return I18N::translate('Charts'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Charts” module */ return I18N::translate('An alternative way to display charts.'); diff --git a/app/Module/CkeditorModule.php b/app/Module/CkeditorModule.php index 44561562fe..2ced6ce467 100644 --- a/app/Module/CkeditorModule.php +++ b/app/Module/CkeditorModule.php @@ -23,14 +23,14 @@ use Fisharebest\Webtrees\I18N; class CkeditorModule extends AbstractModule { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module. CKEditor is a trademark. Do not translate it? http://ckeditor.com */ return I18N::translate('CKEditor™'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “CKEditor” module. WYSIWYG = “what you see is what you get” */ return I18N::translate('Allow other modules to edit text using a “WYSIWYG” editor, instead of using HTML codes.'); diff --git a/app/Module/ClippingsCartModule.php b/app/Module/ClippingsCartModule.php index ee2ac67dce..1b3ba930e4 100644 --- a/app/Module/ClippingsCartModule.php +++ b/app/Module/ClippingsCartModule.php @@ -63,14 +63,14 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface ]; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Clippings cart'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Clippings cart” module */ return I18N::translate('Select records from your family tree and save them as a GEDCOM file.'); @@ -83,7 +83,7 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_USER; } @@ -93,7 +93,7 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface * * @return int */ - public function defaultMenuOrder() + public function defaultMenuOrder(): int { return 20; } diff --git a/app/Module/CompactTreeChartModule.php b/app/Module/CompactTreeChartModule.php index 5a9d632ec0..0b5186eaec 100644 --- a/app/Module/CompactTreeChartModule.php +++ b/app/Module/CompactTreeChartModule.php @@ -30,7 +30,7 @@ class CompactTreeChartModule extends AbstractModule implements ModuleChartInterf * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Compact tree'); @@ -41,7 +41,7 @@ class CompactTreeChartModule extends AbstractModule implements ModuleChartInterf * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “CompactTreeChart” module */ return I18N::translate('A chart of an individual’s ancestors, as a compact tree.'); @@ -54,7 +54,7 @@ class CompactTreeChartModule extends AbstractModule implements ModuleChartInterf * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/DeathReportModule.php b/app/Module/DeathReportModule.php index ff49e5c323..1351435ded 100644 --- a/app/Module/DeathReportModule.php +++ b/app/Module/DeathReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class DeathReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class DeathReportModule extends AbstractModule implements ModuleReportInterface } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Deaths” module */ @@ -48,7 +48,7 @@ class DeathReportModule extends AbstractModule implements ModuleReportInterface * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/DescendancyChartModule.php b/app/Module/DescendancyChartModule.php index 4ae2f27f19..46a31ecee9 100644 --- a/app/Module/DescendancyChartModule.php +++ b/app/Module/DescendancyChartModule.php @@ -30,7 +30,7 @@ class DescendancyChartModule extends AbstractModule implements ModuleChartInterf * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Descendants'); @@ -41,7 +41,7 @@ class DescendancyChartModule extends AbstractModule implements ModuleChartInterf * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “DescendancyChart” module */ return I18N::translate('A chart of an individual’s descendants.'); @@ -54,7 +54,7 @@ class DescendancyChartModule extends AbstractModule implements ModuleChartInterf * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/DescendancyModule.php b/app/Module/DescendancyModule.php index 50a2faad93..529afac487 100644 --- a/app/Module/DescendancyModule.php +++ b/app/Module/DescendancyModule.php @@ -30,14 +30,14 @@ use Symfony\Component\HttpFoundation\Response; class DescendancyModule extends AbstractModule implements ModuleSidebarInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/sidebar */ return I18N::translate('Descendants'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Descendants” module */ return I18N::translate('A sidebar showing the descendants of an individual.'); @@ -104,13 +104,13 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface } /** {@inheritdoc} */ - public function defaultSidebarOrder() + public function defaultSidebarOrder(): int { return 30; } /** {@inheritdoc} */ - public function hasSidebarContent(Individual $individual) + public function hasSidebarContent(Individual $individual): bool { return true; } @@ -122,7 +122,7 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface * * @return string */ - public function getSidebarContent(Individual $individual) + public function getSidebarContent(Individual $individual): string { return view('modules/descendancy/sidebar', [ 'individual_list' => $this->getPersonLi($individual, 1), @@ -137,7 +137,7 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface * * @return string */ - public function getPersonLi(Individual $person, $generations = 0) + public function getPersonLi(Individual $person, $generations = 0): string { $icon = $generations > 0 ? 'icon-minus' : 'icon-plus'; $lifespan = $person->canShow() ? '(' . $person->getLifeSpan() . ')' : ''; @@ -168,7 +168,7 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface * * @return string */ - public function getFamilyLi(Family $family, Individual $person, $generations = 0) + public function getFamilyLi(Family $family, Individual $person, $generations = 0): string { $spouse = $family->getSpouse($person); if ($spouse) { diff --git a/app/Module/DescendancyReportModule.php b/app/Module/DescendancyReportModule.php index dd9dabfc4b..24e7b7563d 100644 --- a/app/Module/DescendancyReportModule.php +++ b/app/Module/DescendancyReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class DescendancyReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class DescendancyReportModule extends AbstractModule implements ModuleReportInte } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Descendants” module */ @@ -48,7 +48,7 @@ class DescendancyReportModule extends AbstractModule implements ModuleReportInte * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/ExtraInformationModule.php b/app/Module/ExtraInformationModule.php index 8375115fea..63c50537d0 100644 --- a/app/Module/ExtraInformationModule.php +++ b/app/Module/ExtraInformationModule.php @@ -27,27 +27,27 @@ use Fisharebest\Webtrees\Individual; class ExtraInformationModule extends AbstractModule implements ModuleSidebarInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/sidebar */ return I18N::translate('Extra information'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Extra information” module */ return I18N::translate('A sidebar showing non-genealogy information about an individual.'); } /** {@inheritdoc} */ - public function defaultSidebarOrder() + public function defaultSidebarOrder(): int { return 10; } /** {@inheritdoc} */ - public function hasSidebarContent(Individual $individual) + public function hasSidebarContent(Individual $individual): bool { return true; } @@ -59,7 +59,7 @@ class ExtraInformationModule extends AbstractModule implements ModuleSidebarInte * * @return string */ - public function getSidebarContent(Individual $individual) + public function getSidebarContent(Individual $individual): string { $indifacts = []; // The individual’s own facts diff --git a/app/Module/FactSourcesReportModule.php b/app/Module/FactSourcesReportModule.php index 0da91614b6..51055861c4 100644 --- a/app/Module/FactSourcesReportModule.php +++ b/app/Module/FactSourcesReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class FactSourcesReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class FactSourcesReportModule extends AbstractModule implements ModuleReportInte } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Source” module */ @@ -48,7 +48,7 @@ class FactSourcesReportModule extends AbstractModule implements ModuleReportInte * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_USER; } diff --git a/app/Module/FamilyBookChartModule.php b/app/Module/FamilyBookChartModule.php index 6d5e82eb90..426b311d50 100644 --- a/app/Module/FamilyBookChartModule.php +++ b/app/Module/FamilyBookChartModule.php @@ -30,7 +30,7 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Family book'); @@ -41,7 +41,7 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “FamilyBookChart” module */ return I18N::translate('A chart of an individual’s ancestors and descendants, as a family book.'); @@ -54,7 +54,7 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/FamilyGroupReportModule.php b/app/Module/FamilyGroupReportModule.php index f8afa56bbb..68da411359 100644 --- a/app/Module/FamilyGroupReportModule.php +++ b/app/Module/FamilyGroupReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class FamilyGroupReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class FamilyGroupReportModule extends AbstractModule implements ModuleReportInte } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Family” module */ @@ -48,7 +48,7 @@ class FamilyGroupReportModule extends AbstractModule implements ModuleReportInte * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/FamilyNavigatorModule.php b/app/Module/FamilyNavigatorModule.php index 04a3ad2ec5..d2c051d609 100644 --- a/app/Module/FamilyNavigatorModule.php +++ b/app/Module/FamilyNavigatorModule.php @@ -24,27 +24,27 @@ use Fisharebest\Webtrees\Individual; class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/sidebar */ return I18N::translate('Family navigator'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Family navigator” module */ return I18N::translate('A sidebar showing an individual’s close families and relatives.'); } /** {@inheritdoc} */ - public function defaultSidebarOrder() + public function defaultSidebarOrder(): int { return 20; } /** {@inheritdoc} */ - public function hasSidebarContent(Individual $individual) + public function hasSidebarContent(Individual $individual): bool { return true; } @@ -56,7 +56,7 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter * * @return string */ - public function getSidebarContent(Individual $individual) + public function getSidebarContent(Individual $individual): string { return view('modules/family_nav/sidebar', ['individual' => $individual]); } diff --git a/app/Module/FamilyTreeFavoritesModule.php b/app/Module/FamilyTreeFavoritesModule.php index 61dbca3300..566bb82611 100644 --- a/app/Module/FamilyTreeFavoritesModule.php +++ b/app/Module/FamilyTreeFavoritesModule.php @@ -35,7 +35,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Favorites'); @@ -46,7 +46,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Favorites” module */ return I18N::translate('Display and manage a family tree’s favorite pages.'); @@ -148,7 +148,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt * * @return stdClass[] */ - public function getFavorites(Tree $tree) + public function getFavorites(Tree $tree): array { $favorites = Database::prepare( "SELECT favorite_id, user_id, gedcom_id, xref, favorite_type, title, note, url" . diff --git a/app/Module/FamilyTreeNewsModule.php b/app/Module/FamilyTreeNewsModule.php index 04c0db1e4e..7a4034bc1d 100644 --- a/app/Module/FamilyTreeNewsModule.php +++ b/app/Module/FamilyTreeNewsModule.php @@ -52,7 +52,7 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('News'); @@ -63,7 +63,7 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “News” module */ return I18N::translate('Family news and site announcements.'); diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php index 62b3cd846f..615987df45 100644 --- a/app/Module/FamilyTreeStatisticsModule.php +++ b/app/Module/FamilyTreeStatisticsModule.php @@ -32,14 +32,14 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn const DEFAULT_NUMBER_OF_SURNAMES = 10; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Statistics'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of “Statistics” module */ return I18N::translate('The size of the family tree, earliest and latest events, common names, etc.'); diff --git a/app/Module/FanChartModule.php b/app/Module/FanChartModule.php index 03e46c3b4b..9da815e988 100644 --- a/app/Module/FanChartModule.php +++ b/app/Module/FanChartModule.php @@ -30,7 +30,7 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Fan chart'); @@ -41,7 +41,7 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Fan Chart” module */ return I18N::translate('A fan chart of an individual’s ancestors.'); @@ -54,7 +54,7 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/FrequentlyAskedQuestionsModule.php b/app/Module/FrequentlyAskedQuestionsModule.php index b2f9d057b7..947eb1d7e4 100644 --- a/app/Module/FrequentlyAskedQuestionsModule.php +++ b/app/Module/FrequentlyAskedQuestionsModule.php @@ -30,14 +30,14 @@ use Symfony\Component\HttpFoundation\Response; class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMenuInterface, ModuleConfigInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module. Abbreviation for “Frequently Asked Questions” */ return I18N::translate('FAQ'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “FAQ” module */ return I18N::translate('A list of frequently asked questions and answers.'); @@ -48,7 +48,7 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen * * @return string */ - public function getConfigLink() + public function getConfigLink(): string { return route('module', [ 'module' => $this->getName(), @@ -61,7 +61,7 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen * * @return int */ - public function defaultMenuOrder() + public function defaultMenuOrder(): int { return 40; } diff --git a/app/Module/HourglassChartModule.php b/app/Module/HourglassChartModule.php index 5d3a4519b2..e69b79aa38 100644 --- a/app/Module/HourglassChartModule.php +++ b/app/Module/HourglassChartModule.php @@ -30,7 +30,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Hourglass chart'); @@ -41,7 +41,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “HourglassChart” module */ return I18N::translate('An hourglass chart of an individual’s ancestors and descendants.'); @@ -54,7 +54,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/HtmlBlockModule.php b/app/Module/HtmlBlockModule.php index 68e03cff7a..41d5a7b1ff 100644 --- a/app/Module/HtmlBlockModule.php +++ b/app/Module/HtmlBlockModule.php @@ -28,14 +28,14 @@ use Symfony\Component\HttpFoundation\Request; class HtmlBlockModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('HTML'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “HTML” module */ return I18N::translate('Add your own text and graphics.'); diff --git a/app/Module/IndividualFactsTabModule.php b/app/Module/IndividualFactsTabModule.php index 35d0e73ff3..4c4fa1515b 100644 --- a/app/Module/IndividualFactsTabModule.php +++ b/app/Module/IndividualFactsTabModule.php @@ -30,27 +30,27 @@ use Fisharebest\Webtrees\Site; class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/tab on the individual page. */ return I18N::translate('Facts and events'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Facts and events” module */ return I18N::translate('A tab showing the facts and events of an individual.'); } /** {@inheritdoc} */ - public function defaultTabOrder() + public function defaultTabOrder(): int { return 10; } /** {@inheritdoc} */ - public function isGrayedOut(Individual $individual) + public function isGrayedOut(Individual $individual): bool { return false; } @@ -133,13 +133,13 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf } /** {@inheritdoc} */ - public function hasTabContent(Individual $individual) + public function hasTabContent(Individual $individual): bool { return true; } /** {@inheritdoc} */ - public function canLoadAjax() + public function canLoadAjax(): bool { return false; } @@ -152,7 +152,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf * * @return Fact[] */ - private static function spouseFacts(Individual $individual, Individual $spouse) + private static function spouseFacts(Individual $individual, Individual $spouse): array { $SHOW_RELATIVES_EVENTS = $individual->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); @@ -186,7 +186,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf * * @return Fact[] */ - private static function childFacts(Individual $person, Family $family, $option, $relation) + private static function childFacts(Individual $person, Family $family, $option, $relation): array { $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); @@ -318,7 +318,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf * * @return Fact[] */ - private static function parentFacts(Individual $person, $sosa) + private static function parentFacts(Individual $person, $sosa): array { $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); @@ -417,7 +417,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf * * @return Fact[] */ - private static function historicalFacts(Individual $person) + private static function historicalFacts(Individual $person): array { $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS'); @@ -451,7 +451,7 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf * * @return Fact[] */ - private static function associateFacts(Individual $person) + private static function associateFacts(Individual $person): array { $facts = []; diff --git a/app/Module/IndividualFamiliesReportModule.php b/app/Module/IndividualFamiliesReportModule.php index 75f6bf3875..9921828e25 100644 --- a/app/Module/IndividualFamiliesReportModule.php +++ b/app/Module/IndividualFamiliesReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class IndividualFamiliesReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class IndividualFamiliesReportModule extends AbstractModule implements ModuleRep } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Related families” */ @@ -48,7 +48,7 @@ class IndividualFamiliesReportModule extends AbstractModule implements ModuleRep * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_USER; } diff --git a/app/Module/IndividualReportModule.php b/app/Module/IndividualReportModule.php index 6a8d66cb9f..ecd91c2005 100644 --- a/app/Module/IndividualReportModule.php +++ b/app/Module/IndividualReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class IndividualReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class IndividualReportModule extends AbstractModule implements ModuleReportInter } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Individual” module */ @@ -48,7 +48,7 @@ class IndividualReportModule extends AbstractModule implements ModuleReportInter * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/InteractiveTree/TreeView.php b/app/Module/InteractiveTree/TreeView.php index bd58a55d2b..834f7184fd 100644 --- a/app/Module/InteractiveTree/TreeView.php +++ b/app/Module/InteractiveTree/TreeView.php @@ -47,7 +47,7 @@ class TreeView * * @return string[] HTML and Javascript */ - public function drawViewport(Individual $individual, $generations) + public function drawViewport(Individual $individual, $generations): array { $html = view('interactive-tree-chart', [ 'name' => $this->name, @@ -68,7 +68,7 @@ class TreeView * * @return string */ - public function getPersons(Tree $tree, $list) + public function getPersons(Tree $tree, $list): string { $list = explode(';', $list); $r = []; @@ -108,7 +108,7 @@ class TreeView * * @return string */ - public function getDetails(Individual $individual) + public function getDetails(Individual $individual): string { $html = $this->getPersonDetails($individual, null); foreach ($individual->getSpouseFamilies() as $family) { @@ -129,7 +129,7 @@ class TreeView * * @return string */ - private function getPersonDetails(Individual $individual, Family $family = null) + private function getPersonDetails(Individual $individual, Family $family = null): string { $chart_url = route('module', [ 'module' => 'tree', @@ -164,7 +164,7 @@ class TreeView * * @return string */ - private function drawChildren(array $familyList, $gen = 1, $ajax = false) + private function drawChildren(array $familyList, $gen = 1, $ajax = false): string { $html = ''; $children2draw = []; @@ -224,7 +224,7 @@ class TreeView * (for "life partner") here fits much better than "spouse" or "mate" * to translate properly the modern french meaning of "conjoint" */ - private function drawPerson(Individual $person, $gen, $state, Family $pfamily = null, $order = null, $isRoot = false) + private function drawPerson(Individual $person, $gen, $state, Family $pfamily = null, $order = null, $isRoot = false): string { if ($gen < 0) { return ''; @@ -329,7 +329,7 @@ class TreeView * * @return string */ - private function drawPersonName(Individual $individual, $dashed = '') + private function drawPersonName(Individual $individual, $dashed = ''): string { $family = $individual->getPrimaryChildFamily(); if ($family) { @@ -383,7 +383,7 @@ class TreeView * and some other browsers (ex: firefox) shows a <div> tag, which have no size limit in height * Therefore, Firefox is a good choice to print very big trees. */ - private function drawVerticalLine($order) + private function drawVerticalLine($order): string { return '<td class="tv_vline tv_vline_' . $order . '"><div class="tv_vline tv_vline_' . $order . '"></div></td>'; } @@ -391,7 +391,7 @@ class TreeView /** * Draw an horizontal line */ - private function drawHorizontalLine() + private function drawHorizontalLine(): string { return '<td class="tv_hline"><div class="tv_hline"></div></td>'; } diff --git a/app/Module/InteractiveTreeModule.php b/app/Module/InteractiveTreeModule.php index 248fe07020..7cf84310b0 100644 --- a/app/Module/InteractiveTreeModule.php +++ b/app/Module/InteractiveTreeModule.php @@ -33,14 +33,14 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface, ModuleChartInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Interactive tree'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Interactive tree” module */ return I18N::translate('An interactive tree, showing all the ancestors and descendants of an individual.'); diff --git a/app/Module/LifespansChartModule.php b/app/Module/LifespansChartModule.php index 7c15e199ad..7c0fe34f90 100644 --- a/app/Module/LifespansChartModule.php +++ b/app/Module/LifespansChartModule.php @@ -30,7 +30,7 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Lifespans'); @@ -41,7 +41,7 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “LifespansChart” module */ return I18N::translate('A chart of individuals’ lifespans.'); @@ -54,7 +54,7 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/LoggedInUsersModule.php b/app/Module/LoggedInUsersModule.php index 00bebd3aed..86776cd513 100644 --- a/app/Module/LoggedInUsersModule.php +++ b/app/Module/LoggedInUsersModule.php @@ -29,14 +29,14 @@ use Symfony\Component\HttpFoundation\Request; class LoggedInUsersModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module. (A list of users who are online now) */ return I18N::translate('Who is online'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Who is online” module */ return I18N::translate('A list of users and visitors who are currently online.'); diff --git a/app/Module/LoginBlockModule.php b/app/Module/LoginBlockModule.php index fbeeb59268..683523f3c4 100644 --- a/app/Module/LoginBlockModule.php +++ b/app/Module/LoginBlockModule.php @@ -27,14 +27,14 @@ use Symfony\Component\HttpFoundation\Request; class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Sign in'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Sign in” module */ return I18N::translate('An alternative way to sign in and sign out.'); diff --git a/app/Module/MarriageReportModule.php b/app/Module/MarriageReportModule.php index cfefa939c0..6f5c815e9a 100644 --- a/app/Module/MarriageReportModule.php +++ b/app/Module/MarriageReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class MarriageReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class MarriageReportModule extends AbstractModule implements ModuleReportInterfa } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Marriages” module */ @@ -48,7 +48,7 @@ class MarriageReportModule extends AbstractModule implements ModuleReportInterfa * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/MediaTabModule.php b/app/Module/MediaTabModule.php index dab1778439..4438813445 100644 --- a/app/Module/MediaTabModule.php +++ b/app/Module/MediaTabModule.php @@ -29,33 +29,33 @@ class MediaTabModule extends AbstractModule implements ModuleTabInterface private $facts; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Media'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Media” module */ return I18N::translate('A tab showing the media objects linked to an individual.'); } /** {@inheritdoc} */ - public function defaultTabOrder() + public function defaultTabOrder(): int { return 50; } /** {@inheritdoc} */ - public function hasTabContent(Individual $individual) + public function hasTabContent(Individual $individual): bool { return $individual->canEdit() || $this->getFactsWithMedia($individual); } /** {@inheritdoc} */ - public function isGrayedOut(Individual $individual) + public function isGrayedOut(Individual $individual): bool { return !$this->getFactsWithMedia($individual); } @@ -77,7 +77,7 @@ class MediaTabModule extends AbstractModule implements ModuleTabInterface * * @return Fact[] */ - private function getFactsWithMedia(Individual $individual) + private function getFactsWithMedia(Individual $individual): array { if ($this->facts === null) { $facts = $individual->getFacts(); @@ -101,7 +101,7 @@ class MediaTabModule extends AbstractModule implements ModuleTabInterface } /** {@inheritdoc} */ - public function canLoadAjax() + public function canLoadAjax(): bool { return false; } diff --git a/app/Module/MissingFactsReportModule.php b/app/Module/MissingFactsReportModule.php index 8220dfaa79..6f01f8949c 100644 --- a/app/Module/MissingFactsReportModule.php +++ b/app/Module/MissingFactsReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class MissingFactsReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a module/report */ @@ -34,7 +34,7 @@ class MissingFactsReportModule extends AbstractModule implements ModuleReportInt } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Missing data” */ @@ -48,7 +48,7 @@ class MissingFactsReportModule extends AbstractModule implements ModuleReportInt * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_USER; } diff --git a/app/Module/ModuleConfigInterface.php b/app/Module/ModuleConfigInterface.php index e18f28c5e1..7b92dbc375 100644 --- a/app/Module/ModuleConfigInterface.php +++ b/app/Module/ModuleConfigInterface.php @@ -25,5 +25,5 @@ interface ModuleConfigInterface * * @return string */ - public function getConfigLink(); + public function getConfigLink(): string; } diff --git a/app/Module/ModuleMenuInterface.php b/app/Module/ModuleMenuInterface.php index 5b6b8ae0c3..bd80c2a75a 100644 --- a/app/Module/ModuleMenuInterface.php +++ b/app/Module/ModuleMenuInterface.php @@ -28,7 +28,7 @@ interface ModuleMenuInterface * * @return int */ - public function defaultMenuOrder(); + public function defaultMenuOrder(): int; /** * A menu, to be added to the main application menu. diff --git a/app/Module/ModuleSidebarInterface.php b/app/Module/ModuleSidebarInterface.php index 6e17acac52..b3e9791ed5 100644 --- a/app/Module/ModuleSidebarInterface.php +++ b/app/Module/ModuleSidebarInterface.php @@ -27,7 +27,7 @@ interface ModuleSidebarInterface * * @return int */ - public function defaultSidebarOrder(); + public function defaultSidebarOrder(): int; /** * Sidebar content. @@ -36,7 +36,7 @@ interface ModuleSidebarInterface * * @return string */ - public function getSidebarContent(Individual $individual); + public function getSidebarContent(Individual $individual): string; /** * Does this sidebar have anything to display for this individual? @@ -45,5 +45,5 @@ interface ModuleSidebarInterface * * @return bool */ - public function hasSidebarContent(Individual $individual); + public function hasSidebarContent(Individual $individual): bool; } diff --git a/app/Module/ModuleTabInterface.php b/app/Module/ModuleTabInterface.php index 7d8edab76b..a149fd72c9 100644 --- a/app/Module/ModuleTabInterface.php +++ b/app/Module/ModuleTabInterface.php @@ -28,7 +28,7 @@ interface ModuleTabInterface * * @return int */ - public function defaultTabOrder(); + public function defaultTabOrder(): int; /** * Generate the HTML content of this tab. @@ -37,7 +37,7 @@ interface ModuleTabInterface * * @return string */ - public function getTabContent(Individual $individual); + public function getTabContent(Individual $individual): string; /** * Is this tab empty? If so, we don't always need to display it. @@ -46,14 +46,14 @@ interface ModuleTabInterface * * @return bool */ - public function hasTabContent(Individual $individual); + public function hasTabContent(Individual $individual): bool; /** * Can this tab load asynchronously? * * @return bool */ - public function canLoadAjax(); + public function canLoadAjax(): bool; /** * A greyed out tab has no actual content, but may perhaps have @@ -63,5 +63,5 @@ interface ModuleTabInterface * * @return bool */ - public function isGrayedOut(Individual $individual); + public function isGrayedOut(Individual $individual): bool; } diff --git a/app/Module/NotesTabModule.php b/app/Module/NotesTabModule.php index 2b08e1b540..e2e151ce02 100644 --- a/app/Module/NotesTabModule.php +++ b/app/Module/NotesTabModule.php @@ -29,33 +29,33 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface private $facts; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Notes'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Notes” module */ return I18N::translate('A tab showing the notes attached to an individual.'); } /** {@inheritdoc} */ - public function defaultTabOrder() + public function defaultTabOrder(): int { return 40; } /** {@inheritdoc} */ - public function hasTabContent(Individual $individual) + public function hasTabContent(Individual $individual): bool { return $individual->canEdit() || $this->getFactsWithNotes($individual); } /** {@inheritdoc} */ - public function isGrayedOut(Individual $individual) + public function isGrayedOut(Individual $individual): bool { return !$this->getFactsWithNotes($individual); } @@ -77,7 +77,7 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface * * @return Fact[] */ - private function getFactsWithNotes(Individual $individual) + private function getFactsWithNotes(Individual $individual): array { if ($this->facts === null) { $facts = $individual->getFacts(); @@ -101,7 +101,7 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface } /** {@inheritdoc} */ - public function canLoadAjax() + public function canLoadAjax(): bool { return false; } diff --git a/app/Module/OccupationReportModule.php b/app/Module/OccupationReportModule.php index 697cbe6679..babaeea150 100644 --- a/app/Module/OccupationReportModule.php +++ b/app/Module/OccupationReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class OccupationReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a report */ @@ -34,7 +34,7 @@ class OccupationReportModule extends AbstractModule implements ModuleReportInter } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Occupations” module */ @@ -48,7 +48,7 @@ class OccupationReportModule extends AbstractModule implements ModuleReportInter * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_USER; } diff --git a/app/Module/OnThisDayModule.php b/app/Module/OnThisDayModule.php index 639ba10ca5..654ecb0035 100644 --- a/app/Module/OnThisDayModule.php +++ b/app/Module/OnThisDayModule.php @@ -72,7 +72,7 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('On this day'); @@ -83,7 +83,7 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “On this day” module */ return I18N::translate('A list of the anniversaries that occur today.'); diff --git a/app/Module/PedigreeChartModule.php b/app/Module/PedigreeChartModule.php index 150d56162a..2e757b1a20 100644 --- a/app/Module/PedigreeChartModule.php +++ b/app/Module/PedigreeChartModule.php @@ -30,7 +30,7 @@ class PedigreeChartModule extends AbstractModule implements ModuleChartInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Pedigree'); @@ -41,7 +41,7 @@ class PedigreeChartModule extends AbstractModule implements ModuleChartInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “PedigreeChart” module */ return I18N::translate('A chart of an individual’s ancestors, formatted as a tree.'); @@ -54,7 +54,7 @@ class PedigreeChartModule extends AbstractModule implements ModuleChartInterface * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/PedigreeMapModule.php b/app/Module/PedigreeMapModule.php index 75c6c13ef4..20605d02fa 100644 --- a/app/Module/PedigreeMapModule.php +++ b/app/Module/PedigreeMapModule.php @@ -58,21 +58,21 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface private static $map_selections = null; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Pedigree map'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “OSM” module */ return I18N::translate('Show the birthplace of ancestors on a map.'); } /** {@inheritdoc} */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } @@ -84,7 +84,7 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface * * @return Menu */ - public function getChartMenu(Individual $individual) + public function getChartMenu(Individual $individual): Menu { return new Menu( I18N::translate('Pedigree map'), @@ -105,7 +105,7 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface * * @return Menu */ - public function getBoxChartMenu(Individual $individual) + public function getBoxChartMenu(Individual $individual): Menu { return $this->getChartMenu($individual); } @@ -184,7 +184,7 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface * * @return array */ - private function getPedigreeMapFacts(Request $request, Tree $tree) + private function getPedigreeMapFacts(Request $request, Tree $tree): array { $xref = $request->get('reference'); $individual = Individual::getInstance($xref, $tree); @@ -317,7 +317,7 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface } elseif (!$individual->canShow()) { throw new IndividualAccessDeniedException(); } - + return (object)[ 'name' => 'modules/pedigree-map/pedigree-map-page', 'data' => [ diff --git a/app/Module/PedigreeReportModule.php b/app/Module/PedigreeReportModule.php index 1369ee3810..3447356f25 100644 --- a/app/Module/PedigreeReportModule.php +++ b/app/Module/PedigreeReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class PedigreeReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a report */ @@ -34,7 +34,7 @@ class PedigreeReportModule extends AbstractModule implements ModuleReportInterfa } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Pedigree” module */ @@ -48,7 +48,7 @@ class PedigreeReportModule extends AbstractModule implements ModuleReportInterfa * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/PlacesModule.php b/app/Module/PlacesModule.php index 5ae65d63af..332f725706 100644 --- a/app/Module/PlacesModule.php +++ b/app/Module/PlacesModule.php @@ -39,45 +39,45 @@ class PlacesModule extends AbstractModule implements ModuleTabInterface private static $map_selections = null; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Places'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “OSM” module */ return I18N::translate('Show the location of events on a map.'); } /** {@inheritdoc} */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } /** {@inheritdoc} */ - public function defaultTabOrder() + public function defaultTabOrder(): int { return 4; } /** {@inheritdoc} */ - public function hasTabContent(Individual $individual) + public function hasTabContent(Individual $individual): bool { return true; } /** {@inheritdoc} */ - public function isGrayedOut(Individual $individual) + public function isGrayedOut(Individual $individual): bool { return false; } /** {@inheritdoc} */ - public function canLoadAjax() + public function canLoadAjax(): bool { return true; } @@ -139,7 +139,7 @@ class PlacesModule extends AbstractModule implements ModuleTabInterface * @return array * @throws Exception */ - private function getPersonalFacts(Individual $individual) + private function getPersonalFacts(Individual $individual): array { $facts = $individual->getFacts(); foreach ($individual->getSpouseFamilies() as $family) { diff --git a/app/Module/RecentChangesModule.php b/app/Module/RecentChangesModule.php index 43b6f3aa08..cd81bab4c7 100644 --- a/app/Module/RecentChangesModule.php +++ b/app/Module/RecentChangesModule.php @@ -36,14 +36,14 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface const MAX_DAYS = 90; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Recent changes'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Recent changes” module */ return I18N::translate('A list of records that have been updated recently.'); @@ -209,7 +209,7 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface * * @return GedcomRecord[] List of records with changes */ - private function getRecentChanges(Tree $tree, $days) + private function getRecentChanges(Tree $tree, $days): array { $sql = "SELECT xref FROM `##change`" . @@ -243,7 +243,7 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface * * @return int */ - private static function sortByChangeDateAndName(GedcomRecord $a, GedcomRecord $b) + private static function sortByChangeDateAndName(GedcomRecord $a, GedcomRecord $b): int { return $b->lastChangeTimestamp(true) - $a->lastChangeTimestamp(true) ?: GedcomRecord::compare($a, $b); } @@ -256,7 +256,7 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface * * @return int */ - private static function sortByNameAndChangeDate(GedcomRecord $a, GedcomRecord $b) + private static function sortByNameAndChangeDate(GedcomRecord $a, GedcomRecord $b): int { return GedcomRecord::compare($a, $b) ?: $b->lastChangeTimestamp(true) - $a->lastChangeTimestamp(true); } diff --git a/app/Module/RelatedIndividualsReportModule.php b/app/Module/RelatedIndividualsReportModule.php index 4f73f8c8cc..a09e8225ba 100644 --- a/app/Module/RelatedIndividualsReportModule.php +++ b/app/Module/RelatedIndividualsReportModule.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Tree; class RelatedIndividualsReportModule extends AbstractModule implements ModuleReportInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { // This text also appears in the .XML file - update both together /* I18N: Name of a report */ @@ -34,7 +34,7 @@ class RelatedIndividualsReportModule extends AbstractModule implements ModuleRep } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { // This text also appears in the .XML file - update both together /* I18N: Description of the “Related individuals” module */ @@ -48,7 +48,7 @@ class RelatedIndividualsReportModule extends AbstractModule implements ModuleRep * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/RelationshipsChartModule.php b/app/Module/RelationshipsChartModule.php index 856d2f850a..5cacfba290 100644 --- a/app/Module/RelationshipsChartModule.php +++ b/app/Module/RelationshipsChartModule.php @@ -44,7 +44,7 @@ class RelationshipsChartModule extends AbstractModule implements ModuleConfigInt * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Relationships'); @@ -55,7 +55,7 @@ class RelationshipsChartModule extends AbstractModule implements ModuleConfigInt * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “RelationshipsChart” module */ return I18N::translate('A chart displaying relationships between two individuals.'); @@ -68,7 +68,7 @@ class RelationshipsChartModule extends AbstractModule implements ModuleConfigInt * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } @@ -127,7 +127,7 @@ class RelationshipsChartModule extends AbstractModule implements ModuleConfigInt * * @return string */ - public function getConfigLink() + public function getConfigLink(): string { return route('module', [ 'module' => $this->getName(), diff --git a/app/Module/RelativesTabModule.php b/app/Module/RelativesTabModule.php index 746d271ad8..0f3d26d3a0 100644 --- a/app/Module/RelativesTabModule.php +++ b/app/Module/RelativesTabModule.php @@ -29,7 +29,7 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Families'); @@ -40,7 +40,7 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Families” module */ return I18N::translate('A tab showing the close relatives of an individual.'); @@ -52,7 +52,7 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface * * @return int */ - public function defaultTabOrder() + public function defaultTabOrder(): int { return 20; } @@ -79,19 +79,19 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface } /** {@inheritdoc} */ - public function hasTabContent(Individual $individual) + public function hasTabContent(Individual $individual): bool { return true; } /** {@inheritdoc} */ - public function isGrayedOut(Individual $individual) + public function isGrayedOut(Individual $individual): bool { return false; } /** {@inheritdoc} */ - public function canLoadAjax() + public function canLoadAjax(): bool { return false; } diff --git a/app/Module/ResearchTaskModule.php b/app/Module/ResearchTaskModule.php index 7c8ed7cce2..a1b3d1c5d3 100644 --- a/app/Module/ResearchTaskModule.php +++ b/app/Module/ResearchTaskModule.php @@ -33,14 +33,14 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface const DEFAULT_BLOCK = '1'; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module. Tasks that need further research. */ return I18N::translate('Research tasks'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of “Research tasks” module */ return I18N::translate('A list of tasks and activities that are linked to the family tree.'); diff --git a/app/Module/ReviewChangesModule.php b/app/Module/ReviewChangesModule.php index 75ec7eac9b..ae3d20f814 100644 --- a/app/Module/ReviewChangesModule.php +++ b/app/Module/ReviewChangesModule.php @@ -32,14 +32,14 @@ use Symfony\Component\HttpFoundation\Request; class ReviewChangesModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Pending changes'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Pending changes” module */ return I18N::translate('A list of changes that need to be reviewed by a moderator, and email notifications.'); diff --git a/app/Module/SiteMapModule.php b/app/Module/SiteMapModule.php index 69447bb8f0..6a26339007 100644 --- a/app/Module/SiteMapModule.php +++ b/app/Module/SiteMapModule.php @@ -44,7 +44,7 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module - see http://en.wikipedia.org/wiki/Sitemaps */ return I18N::translate('Sitemaps'); @@ -55,7 +55,7 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Sitemaps” module */ return I18N::translate('Generate sitemap files for search engines.'); @@ -66,7 +66,7 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface * * @return string */ - public function getConfigLink() + public function getConfigLink(): string { return route('module', [ 'module' => $this->getName(), diff --git a/app/Module/SlideShowModule.php b/app/Module/SlideShowModule.php index 3664e8805a..ca820882ea 100644 --- a/app/Module/SlideShowModule.php +++ b/app/Module/SlideShowModule.php @@ -29,14 +29,14 @@ use Symfony\Component\HttpFoundation\Request; class SlideShowModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Slide show'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Slide show” module */ return I18N::translate('Random images from the current family tree.'); diff --git a/app/Module/SourcesTabModule.php b/app/Module/SourcesTabModule.php index c0b94b7f43..d64045e26c 100644 --- a/app/Module/SourcesTabModule.php +++ b/app/Module/SourcesTabModule.php @@ -29,33 +29,33 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface private $facts; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Sources'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Sources” module */ return I18N::translate('A tab showing the sources linked to an individual.'); } /** {@inheritdoc} */ - public function defaultTabOrder() + public function defaultTabOrder(): int { return 30; } /** {@inheritdoc} */ - public function hasTabContent(Individual $individual) + public function hasTabContent(Individual $individual): bool { return $individual->canEdit() || $this->getFactsWithSources($individual); } /** {@inheritdoc} */ - public function isGrayedOut(Individual $individual) + public function isGrayedOut(Individual $individual): bool { return !$this->getFactsWithSources($individual); } @@ -77,7 +77,7 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface * * @return Fact[] */ - private function getFactsWithSources(Individual $individual) + private function getFactsWithSources(Individual $individual): array { if ($this->facts === null) { $facts = $individual->getFacts(); @@ -101,7 +101,7 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface } /** {@inheritdoc} */ - public function canLoadAjax() + public function canLoadAjax(): bool { return false; } diff --git a/app/Module/StatisticsChartModule.php b/app/Module/StatisticsChartModule.php index 324e24bed2..bc809ec1d1 100644 --- a/app/Module/StatisticsChartModule.php +++ b/app/Module/StatisticsChartModule.php @@ -30,7 +30,7 @@ class StatisticsChartModule extends AbstractModule implements ModuleChartInterfa * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Statistics'); @@ -41,7 +41,7 @@ class StatisticsChartModule extends AbstractModule implements ModuleChartInterfa * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “StatisticsChart” module */ return I18N::translate('Various statistics charts.'); @@ -54,7 +54,7 @@ class StatisticsChartModule extends AbstractModule implements ModuleChartInterfa * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/StoriesModule.php b/app/Module/StoriesModule.php index 52c7786e0a..29172cf9fa 100644 --- a/app/Module/StoriesModule.php +++ b/app/Module/StoriesModule.php @@ -32,14 +32,14 @@ use Symfony\Component\HttpFoundation\Response; class StoriesModule extends AbstractModule implements ModuleTabInterface, ModuleConfigInterface, ModuleMenuInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Stories'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Stories” module */ return I18N::translate('Add narrative stories to individuals in the family tree.'); @@ -50,7 +50,7 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module * * @return string */ - public function getConfigLink() + public function getConfigLink(): string { return route('module', [ 'module' => $this->getName(), @@ -133,7 +133,7 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module * * @return int */ - public function defaultMenuOrder() + public function defaultMenuOrder(): int { return 30; } @@ -145,7 +145,7 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_HIDE; } diff --git a/app/Module/ThemeSelectModule.php b/app/Module/ThemeSelectModule.php index bc57feb19d..c587436e90 100644 --- a/app/Module/ThemeSelectModule.php +++ b/app/Module/ThemeSelectModule.php @@ -26,14 +26,14 @@ use Symfony\Component\HttpFoundation\Request; class ThemeSelectModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Theme change'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Theme change” module */ return I18N::translate('An alternative way to select a new theme.'); diff --git a/app/Module/TimelineChartModule.php b/app/Module/TimelineChartModule.php index bd8df89e73..1446d80c94 100644 --- a/app/Module/TimelineChartModule.php +++ b/app/Module/TimelineChartModule.php @@ -30,7 +30,7 @@ class TimelineChartModule extends AbstractModule implements ModuleChartInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module/chart */ return I18N::translate('Timeline'); @@ -41,7 +41,7 @@ class TimelineChartModule extends AbstractModule implements ModuleChartInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “TimelineChart” module */ return I18N::translate('A timeline displaying individual events.'); @@ -54,7 +54,7 @@ class TimelineChartModule extends AbstractModule implements ModuleChartInterface * * @return int */ - public function defaultAccessLevel() + public function defaultAccessLevel(): int { return Auth::PRIV_PRIVATE; } diff --git a/app/Module/TopGivenNamesModule.php b/app/Module/TopGivenNamesModule.php index e673bb8659..8a2268064e 100644 --- a/app/Module/TopGivenNamesModule.php +++ b/app/Module/TopGivenNamesModule.php @@ -27,14 +27,14 @@ use Symfony\Component\HttpFoundation\Request; class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module. Top=Most common */ return I18N::translate('Top given names'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Top given names” module */ return I18N::translate('A list of the most popular given names.'); diff --git a/app/Module/TopPageViewsModule.php b/app/Module/TopPageViewsModule.php index 86e6920ee9..078fc7ad89 100644 --- a/app/Module/TopPageViewsModule.php +++ b/app/Module/TopPageViewsModule.php @@ -32,7 +32,7 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Most viewed pages'); @@ -43,7 +43,7 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Most visited pages” module */ return I18N::translate('A list of the pages that have been viewed the most number of times.'); diff --git a/app/Module/TopSurnamesModule.php b/app/Module/TopSurnamesModule.php index 9e78f4cfe1..79192d376d 100644 --- a/app/Module/TopSurnamesModule.php +++ b/app/Module/TopSurnamesModule.php @@ -36,7 +36,7 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module. Top=Most common */ return I18N::translate('Top surnames'); @@ -47,7 +47,7 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Top surnames” module */ return I18N::translate('A list of the most popular surnames.'); diff --git a/app/Module/UpcomingAnniversariesModule.php b/app/Module/UpcomingAnniversariesModule.php index 64b177c39a..dcde8d9204 100644 --- a/app/Module/UpcomingAnniversariesModule.php +++ b/app/Module/UpcomingAnniversariesModule.php @@ -82,7 +82,7 @@ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockI * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Upcoming events'); @@ -93,7 +93,7 @@ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockI * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Upcoming events” module */ return I18N::translate('A list of the anniversaries that will occur in the near future.'); diff --git a/app/Module/UserFavoritesModule.php b/app/Module/UserFavoritesModule.php index a9d19bec33..9cdda151af 100644 --- a/app/Module/UserFavoritesModule.php +++ b/app/Module/UserFavoritesModule.php @@ -35,7 +35,7 @@ class UserFavoritesModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Favorites'); @@ -46,7 +46,7 @@ class UserFavoritesModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Favorites” module */ return I18N::translate('Display and manage a user’s favorite pages.'); @@ -148,7 +148,7 @@ class UserFavoritesModule extends AbstractModule implements ModuleBlockInterface * * @return stdClass[] */ - public function getFavorites(Tree $tree, User $user) + public function getFavorites(Tree $tree, User $user): array { $favorites = Database::prepare( "SELECT favorite_id, user_id, gedcom_id, xref, favorite_type, title, note, url" . diff --git a/app/Module/UserJournalModule.php b/app/Module/UserJournalModule.php index 12c439fe6c..78c59eb99d 100644 --- a/app/Module/UserJournalModule.php +++ b/app/Module/UserJournalModule.php @@ -47,7 +47,7 @@ class UserJournalModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Journal'); @@ -58,7 +58,7 @@ class UserJournalModule extends AbstractModule implements ModuleBlockInterface * * @return string */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Journal” module */ return I18N::translate('A private area to record notes or keep a journal.'); diff --git a/app/Module/UserMessagesModule.php b/app/Module/UserMessagesModule.php index d576235f8f..617ddb3b90 100644 --- a/app/Module/UserMessagesModule.php +++ b/app/Module/UserMessagesModule.php @@ -32,14 +32,14 @@ use Symfony\Component\HttpFoundation\Response; class UserMessagesModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Messages'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Messages” module */ return I18N::translate('Communicate directly with other users, using private messages.'); diff --git a/app/Module/UserWelcomeModule.php b/app/Module/UserWelcomeModule.php index a0ee130c6b..b1de35add2 100644 --- a/app/Module/UserWelcomeModule.php +++ b/app/Module/UserWelcomeModule.php @@ -28,14 +28,14 @@ use Symfony\Component\HttpFoundation\Request; class UserWelcomeModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('My page'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “My page” module */ return I18N::translate('A greeting message and useful links for a user.'); diff --git a/app/Module/WelcomeBlockModule.php b/app/Module/WelcomeBlockModule.php index a0e101702b..61a73f6f01 100644 --- a/app/Module/WelcomeBlockModule.php +++ b/app/Module/WelcomeBlockModule.php @@ -28,14 +28,14 @@ use Symfony\Component\HttpFoundation\Request; class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module */ return I18N::translate('Home page'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Home page” module */ return I18N::translate('A greeting message for site visitors.'); diff --git a/app/Module/YahrzeitModule.php b/app/Module/YahrzeitModule.php index 6662d1bedc..8b1920251c 100644 --- a/app/Module/YahrzeitModule.php +++ b/app/Module/YahrzeitModule.php @@ -39,14 +39,14 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface const MAX_DAYS = 30; /** {@inheritdoc} */ - public function getTitle() + public function getTitle(): string { /* I18N: Name of a module. Yahrzeiten (the plural of Yahrzeit) are special anniversaries of deaths in the Hebrew faith/calendar. */ return I18N::translate('Yahrzeiten'); } /** {@inheritdoc} */ - public function getDescription() + public function getDescription(): string { /* I18N: Description of the “Yahrzeiten” module. A “Hebrew death” is a death where the date is recorded in the Hebrew calendar. */ return I18N::translate('A list of the Hebrew death anniversaries that will occur in the near future.'); diff --git a/app/Note.php b/app/Note.php index adb81ce4a4..6442bc9dc0 100644 --- a/app/Note.php +++ b/app/Note.php @@ -68,7 +68,7 @@ class Note extends GedcomRecord * * @return bool */ - protected function canShowByType($access_level) + protected function canShowByType($access_level): bool { // Hide notes if they are attached to private records $linked_ids = Database::prepare( @@ -95,7 +95,7 @@ class Note extends GedcomRecord * * @return string */ - protected function createPrivateGedcomRecord($access_level) + protected function createPrivateGedcomRecord($access_level): string { return '0 @' . $this->xref . '@ NOTE ' . I18N::translate('Private'); } diff --git a/app/Place.php b/app/Place.php index 657d97fee5..9d8f180e8e 100644 --- a/app/Place.php +++ b/app/Place.php @@ -49,7 +49,7 @@ class Place * * @return string - e.g. "England" */ - public function lastPart() + public function lastPart(): string { return end($this->gedcom_place); } @@ -60,7 +60,7 @@ class Place * @return int * @throws \Exception */ - public function getPlaceId() + public function getPlaceId(): int { $place_id = 0; foreach (array_reverse($this->gedcom_place) as $place) { @@ -81,7 +81,7 @@ class Place * * @return Place */ - public function getParentPlace() + public function getParentPlace(): Place { return new self(implode(self::GEDCOM_SEPARATOR, array_slice($this->gedcom_place, 1)), $this->tree); } @@ -92,7 +92,7 @@ class Place * @return Place[] * @throws \Exception */ - public function getChildPlaces() + public function getChildPlaces(): array { $children = []; if ($this->getPlaceId()) { @@ -122,7 +122,7 @@ class Place * * @return string */ - public function getURL() + public function getURL(): string { return e(route('place-hierarchy', [ 'parent' => array_reverse($this->gedcom_place), @@ -135,7 +135,7 @@ class Place * * @return string */ - public function getGedcomName() + public function getGedcomName(): string { return implode(self::GEDCOM_SEPARATOR, $this->gedcom_place); } @@ -145,7 +145,7 @@ class Place * * @return string */ - public function getPlaceName() + public function getPlaceName(): string { $place = reset($this->gedcom_place); @@ -157,7 +157,7 @@ class Place * * @return bool */ - public function isEmpty() + public function isEmpty(): bool { return empty($this->gedcom_place); } @@ -215,7 +215,7 @@ class Place * * @return string */ - public function getReverseName() + public function getReverseName(): string { $tmp = []; foreach (array_reverse($this->gedcom_place) as $place) { @@ -233,7 +233,7 @@ class Place * @return Place[] * @throws \Exception */ - public static function allPlaces(Tree $tree) + public static function allPlaces(Tree $tree): array { $places = []; $rows = @@ -271,7 +271,7 @@ class Place * @return Place[] * @throws \Exception */ - public static function findPlaces($filter, Tree $tree) + public static function findPlaces($filter, Tree $tree): array { $places = []; $rows = diff --git a/app/Report/ReportBase.php b/app/Report/ReportBase.php index 96bfd8a9cc..a2eab5a4df 100644 --- a/app/Report/ReportBase.php +++ b/app/Report/ReportBase.php @@ -97,7 +97,7 @@ class ReportBase * Setting up document wide defaults that will be inherited of the report modules * As DEFAULT A4 and Portrait will be used if not set */ - public function setup() + public function setup(): int { // Set RTL direction if (I18N::direction() === 'rtl') { @@ -652,7 +652,7 @@ class ReportBase * * @return int */ - public function setProcessing($p) + public function setProcessing($p): int { $this->processing = $p; @@ -666,7 +666,7 @@ class ReportBase * * @return int */ - public function addTitle($data) + public function addTitle($data): int { $this->title .= $data; @@ -680,7 +680,7 @@ class ReportBase * * @return int */ - public function addDescription($data) + public function addDescription($data): int { $this->rsubject .= $data; @@ -694,7 +694,7 @@ class ReportBase * * @return int */ - public function addStyle($style) + public function addStyle($style): int { $this->Styles[$style['name']] = $style; @@ -708,7 +708,7 @@ class ReportBase * * @return array */ - public function getStyle($s) + public function getStyle($s): array { if (!isset($this->Styles[$s])) { return current($this->Styles); diff --git a/app/Report/ReportBaseCell.php b/app/Report/ReportBaseCell.php index 4adbc9fd20..8979efab2d 100644 --- a/app/Report/ReportBaseCell.php +++ b/app/Report/ReportBaseCell.php @@ -157,7 +157,7 @@ class ReportBaseCell extends ReportBaseElement * * @return float */ - public function getHeight($renderer) + public function getHeight($renderer): float { return $this->height; } @@ -169,7 +169,7 @@ class ReportBaseCell extends ReportBaseElement * * @return int */ - public function setUrl($url) + public function setUrl($url): int { $this->url = $url; @@ -183,7 +183,7 @@ class ReportBaseCell extends ReportBaseElement * * @return float */ - public function getWidth($renderer) + public function getWidth($renderer): float { return $this->width; } diff --git a/app/Report/ReportBaseElement.php b/app/Report/ReportBaseElement.php index cb5e5f2f07..99dcdf96d5 100644 --- a/app/Report/ReportBaseElement.php +++ b/app/Report/ReportBaseElement.php @@ -40,7 +40,7 @@ class ReportBaseElement * * @return float */ - public function getHeight($renderer) + public function getHeight($renderer): float { return 0.0; } @@ -52,7 +52,7 @@ class ReportBaseElement * * @return float */ - public function getWidth($renderer) + public function getWidth($renderer): float { return 0.0; } @@ -64,7 +64,7 @@ class ReportBaseElement * * @return int */ - public function addText($t) + public function addText($t): int { $t = trim($t, "\r\n\t"); $t = str_replace([ @@ -86,7 +86,7 @@ class ReportBaseElement * * @return int */ - public function addNewline() + public function addNewline(): int { $this->text .= "\n"; @@ -98,7 +98,7 @@ class ReportBaseElement * * @return string */ - public function getValue() + public function getValue(): string { return $this->text; } @@ -111,7 +111,7 @@ class ReportBaseElement * * @return int */ - public function setWrapWidth($wrapwidth, $cellwidth) + public function setWrapWidth($wrapwidth, $cellwidth): int { return 0; } diff --git a/app/Report/ReportBaseFootnote.php b/app/Report/ReportBaseFootnote.php index 50989aec93..10cb97f308 100644 --- a/app/Report/ReportBaseFootnote.php +++ b/app/Report/ReportBaseFootnote.php @@ -80,7 +80,7 @@ class ReportBaseFootnote extends ReportBaseElement * * @return int */ - public function addText($t) + public function addText($t): int { $t = trim($t, "\r\n\t"); $t = str_replace([ @@ -124,7 +124,7 @@ class ReportBaseFootnote extends ReportBaseElement * * @return int */ - public function setNum($n) + public function setNum($n): int { $this->num = $n; $this->numText = "$n "; @@ -139,7 +139,7 @@ class ReportBaseFootnote extends ReportBaseElement * * @return int */ - public function setAddlink($a) + public function setAddlink($a): int { $this->addlink = $a; diff --git a/app/Report/ReportBaseHtml.php b/app/Report/ReportBaseHtml.php index 893f122205..159fbf9c61 100644 --- a/app/Report/ReportBaseHtml.php +++ b/app/Report/ReportBaseHtml.php @@ -46,7 +46,7 @@ class ReportBaseHtml extends ReportBaseElement * * @return string */ - public function getStart() + public function getStart(): string { $str = '<' . $this->tag . ' '; foreach ($this->attrs as $key => $value) { @@ -62,7 +62,7 @@ class ReportBaseHtml extends ReportBaseElement * * @return string */ - public function getEnd() + public function getEnd(): string { return '</' . $this->tag . '>'; } diff --git a/app/Report/ReportBaseImage.php b/app/Report/ReportBaseImage.php index 980675f7a7..fe774362ff 100644 --- a/app/Report/ReportBaseImage.php +++ b/app/Report/ReportBaseImage.php @@ -92,7 +92,7 @@ class ReportBaseImage extends ReportBaseElement * * @return float */ - public function getHeight($renderer) + public function getHeight($renderer): float { return $this->height; } @@ -104,7 +104,7 @@ class ReportBaseImage extends ReportBaseElement * * @return float */ - public function getWidth($renderer) + public function getWidth($renderer): float { return $this->width; } diff --git a/app/Report/ReportBaseLine.php b/app/Report/ReportBaseLine.php index 9d70b2ac93..81e46cfeea 100644 --- a/app/Report/ReportBaseLine.php +++ b/app/Report/ReportBaseLine.php @@ -68,7 +68,7 @@ class ReportBaseLine extends ReportBaseElement * * @return number */ - public function getHeight($renderer) + public function getHeight($renderer): float { return abs($this->y2 - $this->y1); } @@ -80,7 +80,7 @@ class ReportBaseLine extends ReportBaseElement * * @return number */ - public function getWidth($renderer) + public function getWidth($renderer): float { return abs($this->x2 - $this->x1); } diff --git a/app/Report/ReportBasePageheader.php b/app/Report/ReportBasePageheader.php index 8db8ebccaa..94c58bb418 100644 --- a/app/Report/ReportBasePageheader.php +++ b/app/Report/ReportBasePageheader.php @@ -36,7 +36,7 @@ class ReportBasePageheader extends ReportBaseElement * * @return int */ - public function textBox() + public function textBox(): int { $this->elements = []; diff --git a/app/Report/ReportBaseText.php b/app/Report/ReportBaseText.php index 05ff4e950f..6f39eb3aa4 100644 --- a/app/Report/ReportBaseText.php +++ b/app/Report/ReportBaseText.php @@ -84,7 +84,7 @@ class ReportBaseText extends ReportBaseElement * * @return string */ - public function getStyleName() + public function getStyleName(): string { return $this->styleName; } diff --git a/app/Report/ReportHtml.php b/app/Report/ReportHtml.php index 3e09a4071a..89cba8bb86 100644 --- a/app/Report/ReportHtml.php +++ b/app/Report/ReportHtml.php @@ -333,7 +333,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlTextbox */ - public function createTextBox($width, $height, $border, $bgcolor, $newline, $left, $top, $pagecheck, $style, $fill, $padding, $reseth) + public function createTextBox($width, $height, $border, $bgcolor, $newline, $left, $top, $pagecheck, $style, $fill, $padding, $reseth): ReportHtmlTextbox { return new ReportHtmlTextbox($width, $height, $border, $bgcolor, $newline, $left, $top, $pagecheck, $style, $fill, $padding, $reseth); } @@ -346,7 +346,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlText */ - public function createText($style, $color) + public function createText($style, $color): ReportHtmlText { return new ReportHtmlText($style, $color); } @@ -358,7 +358,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlFootnote */ - public function createFootnote($style = '') + public function createFootnote($style = ''): ReportHtmlFootnote { return new ReportHtmlFootnote($style); } @@ -368,7 +368,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlPageheader */ - public function createPageHeader() + public function createPageHeader(): ReportHtmlPageheader { return new ReportHtmlPageheader(); } @@ -386,7 +386,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlImage */ - public function createImage($file, $x, $y, $w, $h, $align, $ln) + public function createImage($file, $x, $y, $w, $h, $align, $ln): ReportHtmlImage { return new ReportHtmlImage($file, $x, $y, $w, $h, $align, $ln); } @@ -404,7 +404,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlImage */ - public function createImageFromObject(MediaFile $media_file, $x, $y, $w, $h, $align, $ln) + public function createImageFromObject(MediaFile $media_file, $x, $y, $w, $h, $align, $ln): ReportHtmlImage { return new ReportHtmlImage($media_file->imageUrl($w, $h, ''), $x, $y, $w, $h, $align, $ln); } @@ -419,7 +419,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlLine */ - public function createLine($x1, $y1, $x2, $y2) + public function createLine($x1, $y1, $x2, $y2): ReportHtmlLine { return new ReportHtmlLine($x1, $y1, $x2, $y2); } @@ -432,7 +432,7 @@ class ReportHtml extends ReportBase * * @return ReportHtmlHtml */ - public function createHTML($tag, $attrs) + public function createHTML($tag, $attrs): ReportHtmlHtml { return new ReportHtmlHtml($tag, $attrs); } @@ -484,7 +484,7 @@ class ReportHtml extends ReportBase * * @return int */ - public function addPageHeader($element) + public function addPageHeader($element): int { $this->pageHeaderElements[] = $element; @@ -498,7 +498,7 @@ class ReportHtml extends ReportBase * * @return bool false if not numbered before | object if already numbered */ - public function checkFootnote($footnote) + public function checkFootnote($footnote): bool { $ct = count($this->printedfootnotes); $i = 0; @@ -536,7 +536,7 @@ class ReportHtml extends ReportBase * * @return int Number of lines. 0 if empty line */ - public function countLines($str) + public function countLines($str): int { if ($str == '') { return 0; @@ -550,7 +550,7 @@ class ReportHtml extends ReportBase * * @return string */ - public function getCurrentStyle() + public function getCurrentStyle(): string { return $this->currentStyle; } @@ -560,7 +560,7 @@ class ReportHtml extends ReportBase * * @return int */ - public function getCurrentStyleHeight() + public function getCurrentStyleHeight(): int { if (empty($this->currentStyle)) { return $this->defaultFontSize; @@ -577,7 +577,7 @@ class ReportHtml extends ReportBase * * @return int */ - public function getFootnotesHeight($cellWidth) + public function getFootnotesHeight($cellWidth): int { $h = 0; foreach ($this->printedfootnotes as $element) { @@ -592,7 +592,7 @@ class ReportHtml extends ReportBase * * @return float */ - public function getRemainingWidth() + public function getRemainingWidth(): float { return $this->noMarginWidth - $this->X; } @@ -602,7 +602,7 @@ class ReportHtml extends ReportBase * * @return float */ - public function getPageHeight() + public function getPageHeight(): float { return $this->pageh - $this->topmargin; } @@ -614,7 +614,7 @@ class ReportHtml extends ReportBase * * @return int */ - public function getStringWidth($text) + public function getStringWidth($text): int { $style = $this->getStyle($this->currentStyle); @@ -628,7 +628,7 @@ class ReportHtml extends ReportBase * * @return int */ - public function getTextCellHeight($str) + public function getTextCellHeight($str): int { // Count the number of lines to calculate the height $nl = $this->countLines($str); @@ -642,7 +642,7 @@ class ReportHtml extends ReportBase * * @return float */ - public function getX() + public function getX(): float { return $this->X; } @@ -652,7 +652,7 @@ class ReportHtml extends ReportBase * * @return float */ - public function getY() + public function getY(): float { return $this->Y; } @@ -662,7 +662,7 @@ class ReportHtml extends ReportBase * * @return int */ - public function pageNo() + public function pageNo(): int { return $this->pageN; } @@ -724,7 +724,7 @@ class ReportHtml extends ReportBase * * @return string */ - public function textWrap($str, $width) + public function textWrap($str, $width): string { // Calculate the line width $lw = (int)($width / ($this->getCurrentStyleHeight() / 2)); diff --git a/app/Report/ReportHtmlFootnote.php b/app/Report/ReportHtmlFootnote.php index 596580fca0..1878e70079 100644 --- a/app/Report/ReportHtmlFootnote.php +++ b/app/Report/ReportHtmlFootnote.php @@ -69,7 +69,7 @@ class ReportHtmlFootnote extends ReportBaseFootnote * * @return int Footnote height in points */ - public function getFootnoteHeight($html, $cellWidth = 0) + public function getFootnoteHeight($html, $cellWidth = 0): int { if ($html->getCurrentStyle() != $this->styleName) { $html->setCurrentStyle($this->styleName); @@ -93,7 +93,7 @@ class ReportHtmlFootnote extends ReportBaseFootnote * * @return array */ - public function getWidth($html) + public function getWidth($html): array { // Setup the style name $html->setCurrentStyle('footnotenum'); diff --git a/app/Report/ReportHtmlImage.php b/app/Report/ReportHtmlImage.php index 03b47392d0..91d4be1053 100644 --- a/app/Report/ReportHtmlImage.php +++ b/app/Report/ReportHtmlImage.php @@ -82,7 +82,7 @@ class ReportHtmlImage extends ReportBaseImage * * @return float */ - public function getHeight($html) + public function getHeight($html): float { return $this->height + ($html->cPadding * 2); } diff --git a/app/Report/ReportHtmlText.php b/app/Report/ReportHtmlText.php index 89dc8d5c27..7a7e489a75 100644 --- a/app/Report/ReportHtmlText.php +++ b/app/Report/ReportHtmlText.php @@ -86,7 +86,7 @@ class ReportHtmlText extends ReportBaseText * * @return float */ - public function getHeight($html) + public function getHeight($html): float { $ct = substr_count($this->text, "\n"); if ($ct > 0) { @@ -104,7 +104,7 @@ class ReportHtmlText extends ReportBaseText * * @return array */ - public function getWidth($html) + public function getWidth($html): array { // Setup the style name if ($html->getCurrentStyle() != $this->styleName) { diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php index ac18f8d94e..2c24159384 100644 --- a/app/Report/ReportParserGenerate.php +++ b/app/Report/ReportParserGenerate.php @@ -2725,7 +2725,7 @@ class ReportParserGenerate extends ReportParserBase * * @return string the value of a gedcom tag from the given gedcom record */ - private function getGedcomValue($tag, $level, $gedrec) + private function getGedcomValue($tag, $level, $gedrec): string { if (empty($gedrec)) { return ''; @@ -2800,7 +2800,7 @@ class ReportParserGenerate extends ReportParserBase * * @return string */ - private function substituteVars($expression, $quote) + private function substituteVars($expression, $quote): string { return preg_replace_callback( '/\$(\w+)/', diff --git a/app/Report/ReportParserSetup.php b/app/Report/ReportParserSetup.php index 208b3d893d..415886af48 100644 --- a/app/Report/ReportParserSetup.php +++ b/app/Report/ReportParserSetup.php @@ -34,7 +34,7 @@ class ReportParserSetup extends ReportParserBase * * @return array */ - public function reportProperties() + public function reportProperties(): array { return $this->data; } diff --git a/app/Report/ReportPdf.php b/app/Report/ReportPdf.php index 9a1c78c351..887c0fe294 100644 --- a/app/Report/ReportPdf.php +++ b/app/Report/ReportPdf.php @@ -111,7 +111,7 @@ class ReportPdf extends ReportBase * * @return int */ - public function addElement($element) + public function addElement($element): int { if ($this->processing == 'B') { return $this->pdf->addBody($element); @@ -169,7 +169,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfCell */ - public function createCell($width, $height, $border, $align, $bgcolor, $style, $ln, $top, $left, $fill, $stretch, $bocolor, $tcolor, $reseth) + public function createCell($width, $height, $border, $align, $bgcolor, $style, $ln, $top, $left, $fill, $stretch, $bocolor, $tcolor, $reseth): ReportPdfCell { return new ReportPdfCell($width, $height, $border, $align, $bgcolor, $style, $ln, $top, $left, $fill, $stretch, $bocolor, $tcolor, $reseth); } @@ -192,7 +192,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfTextbox */ - public function createTextBox($width, $height, $border, $bgcolor, $newline, $left, $top, $pagecheck, $style, $fill, $padding, $reseth) + public function createTextBox($width, $height, $border, $bgcolor, $newline, $left, $top, $pagecheck, $style, $fill, $padding, $reseth): ReportPdfTextbox { return new ReportPdfTextbox($width, $height, $border, $bgcolor, $newline, $left, $top, $pagecheck, $style, $fill, $padding, $reseth); } @@ -205,7 +205,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfText */ - public function createText($style, $color) + public function createText($style, $color): ReportPdfText { return new ReportPdfText($style, $color); } @@ -217,7 +217,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfFootnote */ - public function createFootnote($style) + public function createFootnote($style): ReportPdfFootnote { return new ReportPdfFootnote($style); } @@ -227,7 +227,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfPageheader */ - public function createPageHeader() + public function createPageHeader(): ReportPdfPageheader { return new ReportPdfPageheader(); } @@ -245,7 +245,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfImage */ - public function createImage($file, $x, $y, $w, $h, $align, $ln) + public function createImage($file, $x, $y, $w, $h, $align, $ln): ReportPdfImage { return new ReportPdfImage($file, $x, $y, $w, $h, $align, $ln); } @@ -263,7 +263,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfImage */ - public function createImageFromObject(MediaFile $media_file, $x, $y, $w, $h, $align, $ln) + public function createImageFromObject(MediaFile $media_file, $x, $y, $w, $h, $align, $ln): ReportPdfImage { return new ReportPdfImage($media_file->getServerFilename(), $x, $y, $w, $h, $align, $ln); } @@ -278,7 +278,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfLine */ - public function createLine($x1, $y1, $x2, $y2) + public function createLine($x1, $y1, $x2, $y2): ReportPdfLine { return new ReportPdfLine($x1, $y1, $x2, $y2); } @@ -291,7 +291,7 @@ class ReportPdf extends ReportBase * * @return ReportPdfHtml */ - public function createHTML($tag, $attrs) + public function createHTML($tag, $attrs): ReportPdfHtml { return new ReportPdfHtml($tag, $attrs); } diff --git a/app/Report/ReportPdfFootnote.php b/app/Report/ReportPdfFootnote.php index 304204f40d..deef1e370b 100644 --- a/app/Report/ReportPdfFootnote.php +++ b/app/Report/ReportPdfFootnote.php @@ -70,7 +70,7 @@ class ReportPdfFootnote extends ReportBaseFootnote * * @return float $h */ - public function getFootnoteHeight($renderer) + public function getFootnoteHeight($renderer): float { return 0; } @@ -83,7 +83,7 @@ class ReportPdfFootnote extends ReportBaseFootnote * * @return array */ - public function getWidth($pdf) + public function getWidth($pdf): array { // Setup the style name, a font must be selected to calculate the width $pdf->setCurrentStyle('footnotenum'); diff --git a/app/Report/ReportPdfImage.php b/app/Report/ReportPdfImage.php index 4af9a7636e..4a6515e6d1 100644 --- a/app/Report/ReportPdfImage.php +++ b/app/Report/ReportPdfImage.php @@ -102,7 +102,7 @@ class ReportPdfImage extends ReportBaseImage * * @return float */ - public function getHeight($pdf) + public function getHeight($pdf): float { return $this->height; } @@ -114,7 +114,7 @@ class ReportPdfImage extends ReportBaseImage * * @return float */ - public function getWidth($pdf) + public function getWidth($pdf): float { return $this->width; } diff --git a/app/Report/ReportPdfText.php b/app/Report/ReportPdfText.php index 23799a0171..29ef7e8c80 100644 --- a/app/Report/ReportPdfText.php +++ b/app/Report/ReportPdfText.php @@ -90,7 +90,7 @@ class ReportPdfText extends ReportBaseText * * @return float 0 */ - public function getHeight($pdf) + public function getHeight($pdf): float { return 0; } @@ -102,7 +102,7 @@ class ReportPdfText extends ReportBaseText * * @return array */ - public function getWidth($pdf) + public function getWidth($pdf): array { // Setup the style name, a font must be selected to calculate the width if ($pdf->getCurrentStyle() != $this->styleName) { diff --git a/app/Report/ReportTcpdf.php b/app/Report/ReportTcpdf.php index 6134f28537..20a323e2ce 100644 --- a/app/Report/ReportTcpdf.php +++ b/app/Report/ReportTcpdf.php @@ -137,7 +137,7 @@ class ReportTcpdf extends TCPDF * * @return int The number of the Header elements */ - public function addHeader($element) + public function addHeader($element): int { $this->headerElements[] = $element; @@ -151,7 +151,7 @@ class ReportTcpdf extends TCPDF * * @return int The number of the Page Header elements */ - public function addPageHeader($element) + public function addPageHeader($element): int { $this->pageHeaderElements[] = $element; @@ -165,7 +165,7 @@ class ReportTcpdf extends TCPDF * * @return int The number of the Body elements */ - public function addBody($element) + public function addBody($element): int { $this->bodyElements[] = $element; @@ -179,7 +179,7 @@ class ReportTcpdf extends TCPDF * * @return int The number of the Footer elements */ - public function addFooter($element) + public function addFooter($element): int { $this->footerElements[] = $element; @@ -259,7 +259,7 @@ class ReportTcpdf extends TCPDF * * @return string */ - public function getCurrentStyle() + public function getCurrentStyle(): string { return $this->currentStyle; } @@ -283,7 +283,7 @@ class ReportTcpdf extends TCPDF * * @return array */ - public function getStyle($s) + public function getStyle($s): array { if (!isset($this->wt_report->Styles[$s])) { $s = $this->getCurrentStyle(); @@ -301,7 +301,7 @@ class ReportTcpdf extends TCPDF * * @return float */ - public function addMarginX($x) + public function addMarginX($x): float { $m = $this->getMargins(); if ($this->getRTL()) { @@ -335,7 +335,7 @@ class ReportTcpdf extends TCPDF * * @return int */ - public function getFootnotesHeight() + public function getFootnotesHeight(): int { $h = 0; foreach ($this->printedfootnotes as $element) { @@ -350,7 +350,7 @@ class ReportTcpdf extends TCPDF * * @return int */ - public function getCurrentStyleHeight() + public function getCurrentStyleHeight(): int { if (empty($this->currentStyle)) { return $this->wt_report->defaultFontSize; @@ -367,7 +367,7 @@ class ReportTcpdf extends TCPDF * * @return bool false if not numbered befor | object if already numbered */ - public function checkFootnote($footnote) + public function checkFootnote($footnote): bool { $ct = count($this->printedfootnotes); $val = $footnote->getValue(); @@ -409,7 +409,7 @@ class ReportTcpdf extends TCPDF * * @return bool true in case of page break, false otherwise */ - public function checkPageBreakPDF($height) + public function checkPageBreakPDF($height): bool { return $this->checkPageBreak($height); } @@ -419,7 +419,7 @@ class ReportTcpdf extends TCPDF * * @return float Remaining width */ - public function getRemainingWidthPDF() + public function getRemainingWidthPDF(): float { return $this->getRemainingWidth(); } diff --git a/app/Repository.php b/app/Repository.php index 079be829ed..4e39b774a6 100644 --- a/app/Repository.php +++ b/app/Repository.php @@ -72,7 +72,7 @@ class Repository extends GedcomRecord * * @return string */ - protected function createPrivateGedcomRecord($access_level) + protected function createPrivateGedcomRecord($access_level): string { return '0 @' . $this->xref . "@ REPO\n1 NAME " . I18N::translate('Private'); } diff --git a/app/Select2.php b/app/Select2.php index 58ad235216..2e36bb65f5 100644 --- a/app/Select2.php +++ b/app/Select2.php @@ -51,7 +51,7 @@ class Select2 extends Html * * @return string[] */ - private static function commonConfig() + private static function commonConfig(): array { return [ 'autocomplete' => 'off', @@ -71,7 +71,7 @@ class Select2 extends Html * * @return string[] */ - public static function familyConfig(Tree $tree) + public static function familyConfig(Tree $tree): array { $url = route('select2-family', ['ged' => $tree->getName()]); @@ -87,7 +87,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function familySearch(Tree $tree, $page, $query) + public static function familySearch(Tree $tree, $page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; @@ -143,7 +143,7 @@ class Select2 extends Html * * @return string[] */ - public static function flagConfig() + public static function flagConfig(): array { return self::commonConfig() + ['data-ajax--url' => route('select2-flag')]; } @@ -155,7 +155,7 @@ class Select2 extends Html * * @return string */ - public static function flagValue($flag) + public static function flagValue($flag): string { return '<img src="' . WT_MODULES_DIR . 'googlemap/places/flags/' . $flag . '"> ' . $flag; } @@ -168,7 +168,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function flagSearch($page, $query) + public static function flagSearch($page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; @@ -215,7 +215,7 @@ class Select2 extends Html * * @return string[] */ - public static function individualConfig(Tree $tree) + public static function individualConfig(Tree $tree): array { $url = route('select2-individual', ['ged' => $tree->getName()]); @@ -231,7 +231,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function individualSearch(Tree $tree, $page, $query) + public static function individualSearch(Tree $tree, $page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; @@ -281,7 +281,7 @@ class Select2 extends Html * * @return string[] */ - public static function mediaObjectConfig(Tree $tree) + public static function mediaObjectConfig(Tree $tree): array { $url = route('select2-media', ['ged' => $tree->getName()]); @@ -297,7 +297,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function mediaObjectSearch(Tree $tree, $page, $query) + public static function mediaObjectSearch(Tree $tree, $page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; @@ -346,7 +346,7 @@ class Select2 extends Html * * @return string[] */ - public static function noteConfig(Tree $tree) + public static function noteConfig(Tree $tree): array { $url = route('select2-note', ['ged' => $tree->getName()]); @@ -362,7 +362,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function noteSearch(Tree $tree, $page, $query) + public static function noteSearch(Tree $tree, $page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; @@ -411,7 +411,7 @@ class Select2 extends Html * * @return string[] */ - public static function placeConfig(Tree $tree) + public static function placeConfig(Tree $tree): array { $url = route('select2-place', ['ged' => $tree->getName()]); @@ -428,7 +428,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function placeSearch(Tree $tree, $page, $query, $create) + public static function placeSearch(Tree $tree, $page, $query, $create): array { $offset = $page * self::RESULTS_PER_PAGE; $results = []; @@ -510,7 +510,7 @@ class Select2 extends Html * * @return string[] */ - public static function repositoryConfig(Tree $tree) + public static function repositoryConfig(Tree $tree): array { $url = route('select2-repository', ['ged' => $tree->getName()]); @@ -526,7 +526,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function repositorySearch(Tree $tree, $page, $query) + public static function repositorySearch(Tree $tree, $page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; @@ -575,7 +575,7 @@ class Select2 extends Html * * @return string[] */ - public static function sourceConfig(Tree $tree) + public static function sourceConfig(Tree $tree): array { $url = route('select2-source', ['ged' => $tree->getName()]); @@ -591,7 +591,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function sourceSearch(Tree $tree, $page, $query) + public static function sourceSearch(Tree $tree, $page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; @@ -640,7 +640,7 @@ class Select2 extends Html * * @return string[] */ - public static function submitterConfig(Tree $tree) + public static function submitterConfig(Tree $tree): array { $url = route('select2-submitter', ['ged' => $tree->getName()]); @@ -656,7 +656,7 @@ class Select2 extends Html * * @return mixed[] */ - public static function submitterSearch(Tree $tree, $page, $query) + public static function submitterSearch(Tree $tree, $page, $query): array { $offset = $page * self::RESULTS_PER_PAGE; $more = false; diff --git a/app/Services/UpgradeService.php b/app/Services/UpgradeService.php index edc00f4615..d9f5b42b6c 100644 --- a/app/Services/UpgradeService.php +++ b/app/Services/UpgradeService.php @@ -116,7 +116,7 @@ class UpgradeService /** * The upgrade server needs to know a little about this server. */ - private function serverParameters() + private function serverParameters(): array { $mysql_version = Database::prepare("SHOW VARIABLES LIKE 'version'")->fetchOneRow(); diff --git a/app/Session.php b/app/Session.php index 9512c492b2..96b27d4dcb 100644 --- a/app/Session.php +++ b/app/Session.php @@ -90,7 +90,7 @@ class Session * * @return bool */ - public static function has($name) + public static function has($name): bool { return isset($_SESSION[$name]); } @@ -158,7 +158,7 @@ class Session * * @return bool */ - private static function close() + private static function close(): bool { return true; } @@ -170,7 +170,7 @@ class Session * * @return bool */ - private static function destroy(string $id) + private static function destroy(string $id): bool { Database::prepare( "DELETE FROM `##session` WHERE session_id = :session_id" @@ -188,7 +188,7 @@ class Session * * @return bool */ - private static function gc(int $maxlifetime) + private static function gc(int $maxlifetime): bool { Database::prepare( "DELETE FROM `##session` WHERE session_time < DATE_SUB(NOW(), INTERVAL :maxlifetime SECOND)" @@ -204,7 +204,7 @@ class Session * * @return bool */ - private static function open() + private static function open(): bool { return true; } @@ -263,7 +263,7 @@ class Session * * @return string */ - public static function getCsrfToken() + public static function getCsrfToken(): string { if (!Session::has('CSRF_TOKEN')) { $charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcedfghijklmnopqrstuvwxyz0123456789'; diff --git a/app/Site.php b/app/Site.php index 79dbd14eab..417ac40253 100644 --- a/app/Site.php +++ b/app/Site.php @@ -35,7 +35,7 @@ class Site * * @return string */ - public static function getPreference($setting_name, $default = '') + public static function getPreference($setting_name, $default = ''): string { // There are lots of settings, and we need to fetch lots of them on every page // so it is quicker to fetch them all in one go. diff --git a/app/Soundex.php b/app/Soundex.php index 88896f9c62..d95d3375dd 100644 --- a/app/Soundex.php +++ b/app/Soundex.php @@ -25,7 +25,7 @@ class Soundex * * @return string[] */ - public static function getAlgorithms() + public static function getAlgorithms(): array { return [ /* I18N: http://en.wikipedia.org/wiki/Soundex */ @@ -43,7 +43,7 @@ class Soundex * * @return bool */ - public static function compare($soundex1, $soundex2) + public static function compare($soundex1, $soundex2): bool { if ($soundex1 !== '' && $soundex2 !== '') { return !empty(array_intersect(explode(':', $soundex1), explode(':', $soundex2))); @@ -3578,7 +3578,7 @@ class Soundex * * @return string[] List of possible DM codes for the word. */ - private static function daitchMokotoffWord($name) + private static function daitchMokotoffWord($name): array { // Apply special transformation rules to the input string $name = I18N::strtoupper($name); diff --git a/app/Source.php b/app/Source.php index 46d1190c21..d96f72be66 100644 --- a/app/Source.php +++ b/app/Source.php @@ -54,7 +54,7 @@ class Source extends GedcomRecord * * @return bool */ - protected function canShowByType($access_level) + protected function canShowByType($access_level): bool { // Hide sources if they are attached to private repositories ... preg_match_all('/\n1 REPO @(.+)@/', $this->gedcom, $matches); @@ -76,7 +76,7 @@ class Source extends GedcomRecord * * @return string */ - protected function createPrivateGedcomRecord($access_level) + protected function createPrivateGedcomRecord($access_level): string { return '0 @' . $this->xref . "@ SOUR\n1 TITL " . I18N::translate('Private'); } diff --git a/app/Statement.php b/app/Statement.php index cda41f0b62..1ded878454 100644 --- a/app/Statement.php +++ b/app/Statement.php @@ -49,7 +49,7 @@ class Statement * * @return Statement */ - public function execute($bind_variables = []) + public function execute($bind_variables = []): Statement { if ($this->executed) { throw new \Exception('Statement::execute() called twice.'); @@ -123,7 +123,7 @@ class Statement * * @return stdClass[] */ - public function fetchAll() + public function fetchAll(): array { if (!$this->executed) { $this->execute(); @@ -180,7 +180,7 @@ class Statement * * @return string[] */ - public function fetchAssoc() + public function fetchAssoc(): array { if (!$this->executed) { $this->execute(); @@ -202,7 +202,7 @@ class Statement * * @return string[] */ - public function fetchOneColumn() + public function fetchOneColumn(): array { if (!$this->executed) { $this->execute(); @@ -222,7 +222,7 @@ class Statement * * @return int */ - public function rowCount() + public function rowCount(): int { return $this->pdo_statement->rowCount(); } diff --git a/app/Stats.php b/app/Stats.php index fa7cdded39..1f53b30fd9 100644 --- a/app/Stats.php +++ b/app/Stats.php @@ -93,7 +93,7 @@ class Stats * * @return string */ - public function getAllTagsTable() + public function getAllTagsTable(): string { $examples = []; foreach (get_class_methods($this) as $method) { @@ -132,7 +132,7 @@ class Stats * * @return string */ - public function getAllTagsText() + public function getAllTagsText(): string { $examples = []; foreach (get_class_methods($this) as $method) { @@ -153,7 +153,7 @@ class Stats * * @return string[][] */ - private function getTags($text) + private function getTags($text): array { // Extract all tags from the provided text preg_match_all('/#([^#]+)(?=#)/', (string)$text, $match); @@ -196,7 +196,7 @@ class Stats * * @return string */ - public function embedTags($text) + public function embedTags($text): string { if (strpos($text, '#') !== false) { list($new_tags, $new_values) = $this->getTags($text); @@ -211,7 +211,7 @@ class Stats * * @return string */ - public function gedcomFilename() + public function gedcomFilename(): string { return $this->tree->getName(); } @@ -221,7 +221,7 @@ class Stats * * @return int */ - public function gedcomId() + public function gedcomId(): int { return $this->tree->getTreeId(); } @@ -231,7 +231,7 @@ class Stats * * @return string */ - public function gedcomTitle() + public function gedcomTitle(): string { return e($this->tree->getTitle()); } @@ -241,7 +241,7 @@ class Stats * * @return string[] */ - private function gedcomHead() + private function gedcomHead(): array { $title = ''; $version = ''; @@ -267,7 +267,7 @@ class Stats * * @return string */ - public function gedcomCreatedSoftware() + public function gedcomCreatedSoftware(): string { $head = $this->gedcomHead(); @@ -279,7 +279,7 @@ class Stats * * @return string */ - public function gedcomCreatedVersion() + public function gedcomCreatedVersion(): string { $head = $this->gedcomHead(); // fix broken version string in Family Tree Maker @@ -301,7 +301,7 @@ class Stats * * @return string */ - public function gedcomDate() + public function gedcomDate(): string { $head = GedcomRecord::getInstance('HEAD', $this->tree); $fact = $head->getFirstFact('DATE'); @@ -338,7 +338,7 @@ class Stats * * @return string */ - public function gedcomRootId() + public function gedcomRootId(): string { return $this->tree->getPreference('PEDIGREE_ROOT_ID'); } @@ -351,7 +351,7 @@ class Stats * * @return string */ - private function getPercentage(int $total, string $type) + private function getPercentage(int $total, string $type): string { switch ($type) { case 'individual': @@ -380,7 +380,7 @@ class Stats * * @return string */ - public function totalRecords() + public function totalRecords(): string { return I18N::number($this->totalIndividualsQuery() + $this->totalFamiliesQuery() + $this->totalSourcesQuery()); } @@ -390,7 +390,7 @@ class Stats * * @return int */ - private function totalIndividualsQuery() + private function totalIndividualsQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id" @@ -404,7 +404,7 @@ class Stats * * @return string */ - public function totalIndividuals() + public function totalIndividuals(): string { return I18N::number($this->totalIndividualsQuery()); } @@ -414,7 +414,7 @@ class Stats * * @return int */ - private function totalIndisWithSourcesQuery() + private function totalIndisWithSourcesQuery(): int { return (int)Database::prepare( "SELECT COUNT(DISTINCT i_id)" . @@ -430,7 +430,7 @@ class Stats * * @return string */ - public function totalIndisWithSources() + public function totalIndisWithSources(): string { return I18N::number($this->totalIndisWithSourcesQuery()); } @@ -487,7 +487,7 @@ class Stats * * @return string */ - public function totalIndividualsPercentage() + public function totalIndividualsPercentage(): string { return $this->getPercentage($this->totalIndividualsQuery(), 'all'); } @@ -497,7 +497,7 @@ class Stats * * @return int */ - private function totalFamiliesQuery() + private function totalFamiliesQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##families` WHERE f_file = :tree_id" @@ -511,7 +511,7 @@ class Stats * * @return string */ - public function totalFamilies() + public function totalFamilies(): string { return I18N::number($this->totalFamiliesQuery()); } @@ -521,7 +521,7 @@ class Stats * * @return int */ - private function totalFamsWithSourcesQuery() + private function totalFamsWithSourcesQuery(): int { return (int)Database::prepare( "SELECT COUNT(DISTINCT f_id)" . @@ -537,7 +537,7 @@ class Stats * * @return string */ - public function totalFamsWithSources() + public function totalFamsWithSources(): string { return I18N::number($this->totalFamsWithSourcesQuery()); } @@ -594,7 +594,7 @@ class Stats * * @return string */ - public function totalFamiliesPercentage() + public function totalFamiliesPercentage(): string { return $this->getPercentage($this->totalFamiliesQuery(), 'all'); } @@ -604,7 +604,7 @@ class Stats * * @return int */ - private function totalSourcesQuery() + private function totalSourcesQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##sources` WHERE s_file = :tree_id" @@ -618,7 +618,7 @@ class Stats * * @return string */ - public function totalSources() + public function totalSources(): string { return I18N::number($this->totalSourcesQuery()); } @@ -628,7 +628,7 @@ class Stats * * @return string */ - public function totalSourcesPercentage() + public function totalSourcesPercentage(): string { return $this->getPercentage($this->totalSourcesQuery(), 'all'); } @@ -638,7 +638,7 @@ class Stats * * @return int */ - private function totalNotesQuery() + private function totalNotesQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file = :tree_id" @@ -652,7 +652,7 @@ class Stats * * @return string */ - public function totalNotes() + public function totalNotes(): string { return I18N::number($this->totalNotesQuery()); } @@ -662,7 +662,7 @@ class Stats * * @return string */ - public function totalNotesPercentage() + public function totalNotesPercentage(): string { return $this->getPercentage($this->totalNotesQuery(), 'all'); } @@ -672,7 +672,7 @@ class Stats * * @return int */ - private function totalRepositoriesQuery() + private function totalRepositoriesQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file = :tree_id" @@ -686,7 +686,7 @@ class Stats * * @return string */ - public function totalRepositories() + public function totalRepositories(): string { return I18N::number($this->totalRepositoriesQuery()); } @@ -696,7 +696,7 @@ class Stats * * @return string */ - public function totalRepositoriesPercentage() + public function totalRepositoriesPercentage(): string { return $this->getPercentage($this->totalRepositoriesQuery(), 'all'); } @@ -802,7 +802,7 @@ class Stats * * @return string */ - public function totalEventsBirth() + public function totalEventsBirth(): string { return $this->totalEvents(explode('|', WT_EVENTS_BIRT)); } @@ -812,7 +812,7 @@ class Stats * * @return string */ - public function totalBirths() + public function totalBirths(): string { return $this->totalEvents(['BIRT']); } @@ -822,7 +822,7 @@ class Stats * * @return string */ - public function totalEventsDeath() + public function totalEventsDeath(): string { return $this->totalEvents(explode('|', WT_EVENTS_DEAT)); } @@ -832,7 +832,7 @@ class Stats * * @return string */ - public function totalDeaths() + public function totalDeaths(): string { return $this->totalEvents(['DEAT']); } @@ -842,7 +842,7 @@ class Stats * * @return string */ - public function totalEventsMarriage() + public function totalEventsMarriage(): string { return $this->totalEvents(explode('|', WT_EVENTS_MARR)); } @@ -852,7 +852,7 @@ class Stats * * @return string */ - public function totalMarriages() + public function totalMarriages(): string { return $this->totalEvents(['MARR']); } @@ -862,7 +862,7 @@ class Stats * * @return string */ - public function totalEventsDivorce() + public function totalEventsDivorce(): string { return $this->totalEvents(explode('|', WT_EVENTS_DIV)); } @@ -872,7 +872,7 @@ class Stats * * @return string */ - public function totalDivorces() + public function totalDivorces(): string { return $this->totalEvents(['DIV']); } @@ -882,7 +882,7 @@ class Stats * * @return string */ - public function totalEventsOther() + public function totalEventsOther(): string { $facts = array_merge(explode('|', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT)); $no_facts = []; @@ -899,7 +899,7 @@ class Stats * * @return int */ - private function totalSexMalesQuery() + private function totalSexMalesQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'M'" @@ -913,7 +913,7 @@ class Stats * * @return string */ - public function totalSexMales() + public function totalSexMales(): string { return I18N::number($this->totalSexMalesQuery()); } @@ -923,7 +923,7 @@ class Stats * * @return string */ - public function totalSexMalesPercentage() + public function totalSexMalesPercentage(): string { return $this->getPercentage($this->totalSexMalesQuery(), 'individual'); } @@ -933,7 +933,7 @@ class Stats * * @return int */ - private function totalSexFemalesQuery() + private function totalSexFemalesQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'F'" @@ -947,7 +947,7 @@ class Stats * * @return string */ - public function totalSexFemales() + public function totalSexFemales(): string { return I18N::number($this->totalSexFemalesQuery()); } @@ -957,7 +957,7 @@ class Stats * * @return string */ - public function totalSexFemalesPercentage() + public function totalSexFemalesPercentage(): string { return $this->getPercentage($this->totalSexFemalesQuery(), 'individual'); } @@ -967,7 +967,7 @@ class Stats * * @return int */ - private function totalSexUnknownQuery() + private function totalSexUnknownQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'U'" @@ -981,7 +981,7 @@ class Stats * * @return string */ - public function totalSexUnknown() + public function totalSexUnknown(): string { return I18N::number($this->totalSexUnknownQuery()); } @@ -991,7 +991,7 @@ class Stats * * @return string */ - public function totalSexUnknownPercentage() + public function totalSexUnknownPercentage(): string { return $this->getPercentage($this->totalSexUnknownQuery(), 'individual'); } @@ -1081,7 +1081,7 @@ class Stats * * @return int */ - private function totalLivingQuery() + private function totalLivingQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'" @@ -1095,7 +1095,7 @@ class Stats * * @return string */ - public function totalLiving() + public function totalLiving(): string { return I18N::number($this->totalLivingQuery()); } @@ -1105,7 +1105,7 @@ class Stats * * @return string */ - public function totalLivingPercentage() + public function totalLivingPercentage(): string { return $this->getPercentage($this->totalLivingQuery(), 'individual'); } @@ -1115,7 +1115,7 @@ class Stats * * @return int */ - private function totalDeceasedQuery() + private function totalDeceasedQuery(): int { return (int)Database::prepare( "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'" @@ -1129,7 +1129,7 @@ class Stats * * @return string */ - public function totalDeceased() + public function totalDeceased(): string { return I18N::number($this->totalDeceasedQuery()); } @@ -1139,7 +1139,7 @@ class Stats * * @return string */ - public function totalDeceasedPercentage() + public function totalDeceasedPercentage(): string { return $this->getPercentage($this->totalDeceasedQuery(), 'individual'); } @@ -1203,7 +1203,7 @@ class Stats * * @return string */ - public function totalUsers($params = []) + public function totalUsers($params = []): string { if (isset($params[0])) { $total = count(User::all()) + (int)$params[0]; @@ -1219,7 +1219,7 @@ class Stats * * @return string */ - public function totalAdmins() + public function totalAdmins(): string { return I18N::number(count(User::administrators())); } @@ -1229,7 +1229,7 @@ class Stats * * @return string */ - public function totalNonAdmins() + public function totalNonAdmins(): string { return I18N::number(count(User::all()) - count(User::administrators())); } @@ -1241,7 +1241,7 @@ class Stats * * @return int */ - private function totalMediaType($type = 'all') + private function totalMediaType($type = 'all'): int { if (!in_array($type, $this->media_types) && $type != 'all' && $type != 'unknown') { return 0; @@ -1272,7 +1272,7 @@ class Stats * * @return string */ - public function totalMedia() + public function totalMedia(): string { return I18N::number($this->totalMediaType('all')); } @@ -1282,7 +1282,7 @@ class Stats * * @return string */ - public function totalMediaAudio() + public function totalMediaAudio(): string { return I18N::number($this->totalMediaType('audio')); } @@ -1292,7 +1292,7 @@ class Stats * * @return string */ - public function totalMediaBook() + public function totalMediaBook(): string { return I18N::number($this->totalMediaType('book')); } @@ -1302,7 +1302,7 @@ class Stats * * @return string */ - public function totalMediaCard() + public function totalMediaCard(): string { return I18N::number($this->totalMediaType('card')); } @@ -1312,7 +1312,7 @@ class Stats * * @return string */ - public function totalMediaCertificate() + public function totalMediaCertificate(): string { return I18N::number($this->totalMediaType('certificate')); } @@ -1322,7 +1322,7 @@ class Stats * * @return string */ - public function totalMediaCoatOfArms() + public function totalMediaCoatOfArms(): string { return I18N::number($this->totalMediaType('coat')); } @@ -1332,7 +1332,7 @@ class Stats * * @return string */ - public function totalMediaDocument() + public function totalMediaDocument(): string { return I18N::number($this->totalMediaType('document')); } @@ -1342,7 +1342,7 @@ class Stats * * @return string */ - public function totalMediaElectronic() + public function totalMediaElectronic(): string { return I18N::number($this->totalMediaType('electronic')); } @@ -1352,7 +1352,7 @@ class Stats * * @return string */ - public function totalMediaMagazine() + public function totalMediaMagazine(): string { return I18N::number($this->totalMediaType('magazine')); } @@ -1362,7 +1362,7 @@ class Stats * * @return string */ - public function totalMediaManuscript() + public function totalMediaManuscript(): string { return I18N::number($this->totalMediaType('manuscript')); } @@ -1372,7 +1372,7 @@ class Stats * * @return string */ - public function totalMediaMap() + public function totalMediaMap(): string { return I18N::number($this->totalMediaType('map')); } @@ -1382,7 +1382,7 @@ class Stats * * @return string */ - public function totalMediaFiche() + public function totalMediaFiche(): string { return I18N::number($this->totalMediaType('fiche')); } @@ -1392,7 +1392,7 @@ class Stats * * @return string */ - public function totalMediaFilm() + public function totalMediaFilm(): string { return I18N::number($this->totalMediaType('film')); } @@ -1402,7 +1402,7 @@ class Stats * * @return string */ - public function totalMediaNewspaper() + public function totalMediaNewspaper(): string { return I18N::number($this->totalMediaType('newspaper')); } @@ -1412,7 +1412,7 @@ class Stats * * @return string */ - public function totalMediaPainting() + public function totalMediaPainting(): string { return I18N::number($this->totalMediaType('painting')); } @@ -1422,7 +1422,7 @@ class Stats * * @return string */ - public function totalMediaPhoto() + public function totalMediaPhoto(): string { return I18N::number($this->totalMediaType('photo')); } @@ -1432,7 +1432,7 @@ class Stats * * @return string */ - public function totalMediaTombstone() + public function totalMediaTombstone(): string { return I18N::number($this->totalMediaType('tombstone')); } @@ -1442,7 +1442,7 @@ class Stats * * @return string */ - public function totalMediaVideo() + public function totalMediaVideo(): string { return I18N::number($this->totalMediaType('video')); } @@ -1452,7 +1452,7 @@ class Stats * * @return string */ - public function totalMediaOther() + public function totalMediaOther(): string { return I18N::number($this->totalMediaType('other')); } @@ -1462,7 +1462,7 @@ class Stats * * @return string */ - public function totalMediaUnknown() + public function totalMediaUnknown(): string { return I18N::number($this->totalMediaType('unknown')); } @@ -1474,7 +1474,7 @@ class Stats * * @return string */ - public function chartMedia($params = []) + public function chartMedia($params = []): string { $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); @@ -1561,7 +1561,7 @@ class Stats * * @return string */ - private function mortalityQuery($type = 'full', $life_dir = 'ASC', $birth_death = 'BIRT') + private function mortalityQuery($type = 'full', $life_dir = 'ASC', $birth_death = 'BIRT'): string { if ($birth_death == 'MARR') { $query_field = "'MARR'"; @@ -1722,7 +1722,7 @@ class Stats * * @return int */ - private function totalPlacesQuery() + private function totalPlacesQuery(): int { return (int)Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?") @@ -1735,7 +1735,7 @@ class Stats * * @return string */ - public function totalPlaces() + public function totalPlaces(): string { return I18N::number($this->totalPlacesQuery()); } @@ -1747,7 +1747,7 @@ class Stats * * @return string */ - public function chartDistribution($params = []) + public function chartDistribution($params = []): string { $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); @@ -1914,7 +1914,7 @@ class Stats * * @return string */ - public function commonCountriesList() + public function commonCountriesList(): string { $countries = $this->statsPlaces(); if (empty($countries)) { @@ -1967,7 +1967,7 @@ class Stats * * @return string */ - public function commonBirthPlacesList() + public function commonBirthPlacesList(): string { $places = $this->statsPlaces('INDI', 'BIRT'); $top10 = []; @@ -1991,7 +1991,7 @@ class Stats * * @return string */ - public function commonDeathPlacesList() + public function commonDeathPlacesList(): string { $places = $this->statsPlaces('INDI', 'DEAT'); $top10 = []; @@ -2015,7 +2015,7 @@ class Stats * * @return string */ - public function commonMarriagePlacesList() + public function commonMarriagePlacesList(): string { $places = $this->statsPlaces('FAM', 'MARR'); $top10 = []; @@ -2227,7 +2227,7 @@ class Stats * * @return string */ - public function firstBirth() + public function firstBirth(): string { return $this->mortalityQuery('full', 'ASC', 'BIRT'); } @@ -2237,7 +2237,7 @@ class Stats * * @return string */ - public function firstBirthYear() + public function firstBirthYear(): string { return $this->mortalityQuery('year', 'ASC', 'BIRT'); } @@ -2247,7 +2247,7 @@ class Stats * * @return string */ - public function firstBirthName() + public function firstBirthName(): string { return $this->mortalityQuery('name', 'ASC', 'BIRT'); } @@ -2257,7 +2257,7 @@ class Stats * * @return string */ - public function firstBirthPlace() + public function firstBirthPlace(): string { return $this->mortalityQuery('place', 'ASC', 'BIRT'); } @@ -2267,7 +2267,7 @@ class Stats * * @return string */ - public function lastBirth() + public function lastBirth(): string { return $this->mortalityQuery('full', 'DESC', 'BIRT'); } @@ -2277,7 +2277,7 @@ class Stats * * @return string */ - public function lastBirthYear() + public function lastBirthYear(): string { return $this->mortalityQuery('year', 'DESC', 'BIRT'); } @@ -2287,7 +2287,7 @@ class Stats * * @return string */ - public function lastBirthName() + public function lastBirthName(): string { return $this->mortalityQuery('name', 'DESC', 'BIRT'); } @@ -2297,7 +2297,7 @@ class Stats * * @return string */ - public function lastBirthPlace() + public function lastBirthPlace(): string { return $this->mortalityQuery('place', 'DESC', 'BIRT'); } @@ -2309,7 +2309,7 @@ class Stats * * @return string */ - public function statsBirth($params = []) + public function statsBirth($params = []): string { return $this->statsBirthQuery(true, false, -1, -1, $params); } @@ -2319,7 +2319,7 @@ class Stats * * @return string */ - public function firstDeath() + public function firstDeath(): string { return $this->mortalityQuery('full', 'ASC', 'DEAT'); } @@ -2329,7 +2329,7 @@ class Stats * * @return string */ - public function firstDeathYear() + public function firstDeathYear(): string { return $this->mortalityQuery('year', 'ASC', 'DEAT'); } @@ -2339,7 +2339,7 @@ class Stats * * @return string */ - public function firstDeathName() + public function firstDeathName(): string { return $this->mortalityQuery('name', 'ASC', 'DEAT'); } @@ -2349,7 +2349,7 @@ class Stats * * @return string */ - public function firstDeathPlace() + public function firstDeathPlace(): string { return $this->mortalityQuery('place', 'ASC', 'DEAT'); } @@ -2359,7 +2359,7 @@ class Stats * * @return string */ - public function lastDeath() + public function lastDeath(): string { return $this->mortalityQuery('full', 'DESC', 'DEAT'); } @@ -2369,7 +2369,7 @@ class Stats * * @return string */ - public function lastDeathYear() + public function lastDeathYear(): string { return $this->mortalityQuery('year', 'DESC', 'DEAT'); } @@ -2379,7 +2379,7 @@ class Stats * * @return string */ - public function lastDeathName() + public function lastDeathName(): string { return $this->mortalityQuery('name', 'DESC', 'DEAT'); } @@ -2389,7 +2389,7 @@ class Stats * * @return string */ - public function lastDeathPlace() + public function lastDeathPlace(): string { return $this->mortalityQuery('place', 'DESC', 'DEAT'); } @@ -2401,7 +2401,7 @@ class Stats * * @return string */ - public function statsDeath($params = []) + public function statsDeath($params = []): string { return $this->statsDeathQuery(true, false, -1, -1, $params); } @@ -2414,7 +2414,7 @@ class Stats * * @return string */ - private function longlifeQuery($type = 'full', $sex = 'F') + private function longlifeQuery($type = 'full', $sex = 'F'): string { $sex_search = ' 1=1'; if ($sex == 'F') { @@ -2479,7 +2479,7 @@ class Stats * * @return string */ - private function topTenOldestQuery($type = 'list', $sex = 'BOTH', $params = []) + private function topTenOldestQuery($type = 'list', $sex = 'BOTH', $params = []): string { if ($sex === 'F') { $sex_search = " AND i_sex='F' "; @@ -2575,7 +2575,7 @@ class Stats * * @return string */ - private function topTenOldestAliveQuery($type = 'list', $sex = 'BOTH', $params = []) + private function topTenOldestAliveQuery($type = 'list', $sex = 'BOTH', $params = []): string { if (!Auth::isMember($this->tree)) { return I18N::translate('This information is private and cannot be shown.'); @@ -2865,7 +2865,7 @@ class Stats * * @return string */ - public function statsAge($params = []) + public function statsAge($params = []): string { return $this->statsAgeQuery(true, 'BIRT', 'BOTH', -1, -1, $params); } @@ -2875,7 +2875,7 @@ class Stats * * @return string */ - public function longestLife() + public function longestLife(): string { return $this->longlifeQuery('full', 'BOTH'); } @@ -2885,7 +2885,7 @@ class Stats * * @return string */ - public function longestLifeAge() + public function longestLifeAge(): string { return $this->longlifeQuery('age', 'BOTH'); } @@ -2895,7 +2895,7 @@ class Stats * * @return string */ - public function longestLifeName() + public function longestLifeName(): string { return $this->longlifeQuery('name', 'BOTH'); } @@ -2907,7 +2907,7 @@ class Stats * * @return string */ - public function topTenOldest($params = []) + public function topTenOldest($params = []): string { return $this->topTenOldestQuery('nolist', 'BOTH', $params); } @@ -2919,7 +2919,7 @@ class Stats * * @return string */ - public function topTenOldestList($params = []) + public function topTenOldestList($params = []): string { return $this->topTenOldestQuery('list', 'BOTH', $params); } @@ -2931,7 +2931,7 @@ class Stats * * @return string */ - public function topTenOldestAlive($params = []) + public function topTenOldestAlive($params = []): string { return $this->topTenOldestAliveQuery('nolist', 'BOTH', $params); } @@ -2943,7 +2943,7 @@ class Stats * * @return string */ - public function topTenOldestListAlive($params = []) + public function topTenOldestListAlive($params = []): string { return $this->topTenOldestAliveQuery('list', 'BOTH', $params); } @@ -2955,7 +2955,7 @@ class Stats * * @return string */ - public function averageLifespan($show_years = false) + public function averageLifespan($show_years = false): string { return $this->averageLifespanQuery('BOTH', $show_years); } @@ -2965,7 +2965,7 @@ class Stats * * @return string */ - public function longestLifeFemale() + public function longestLifeFemale(): string { return $this->longlifeQuery('full', 'F'); } @@ -2975,7 +2975,7 @@ class Stats * * @return string */ - public function longestLifeFemaleAge() + public function longestLifeFemaleAge(): string { return $this->longlifeQuery('age', 'F'); } @@ -2985,7 +2985,7 @@ class Stats * * @return string */ - public function longestLifeFemaleName() + public function longestLifeFemaleName(): string { return $this->longlifeQuery('name', 'F'); } @@ -2997,7 +2997,7 @@ class Stats * * @return string */ - public function topTenOldestFemale($params = []) + public function topTenOldestFemale($params = []): string { return $this->topTenOldestQuery('nolist', 'F', $params); } @@ -3009,7 +3009,7 @@ class Stats * * @return string */ - public function topTenOldestFemaleList($params = []) + public function topTenOldestFemaleList($params = []): string { return $this->topTenOldestQuery('list', 'F', $params); } @@ -3021,7 +3021,7 @@ class Stats * * @return string */ - public function topTenOldestFemaleAlive($params = []) + public function topTenOldestFemaleAlive($params = []): string { return $this->topTenOldestAliveQuery('nolist', 'F', $params); } @@ -3033,7 +3033,7 @@ class Stats * * @return string */ - public function topTenOldestFemaleListAlive($params = []) + public function topTenOldestFemaleListAlive($params = []): string { return $this->topTenOldestAliveQuery('list', 'F', $params); } @@ -3045,7 +3045,7 @@ class Stats * * @return string */ - public function averageLifespanFemale($show_years = false) + public function averageLifespanFemale($show_years = false): string { return $this->averageLifespanQuery('F', $show_years); } @@ -3055,7 +3055,7 @@ class Stats * * @return string */ - public function longestLifeMale() + public function longestLifeMale(): string { return $this->longlifeQuery('full', 'M'); } @@ -3065,7 +3065,7 @@ class Stats * * @return string */ - public function longestLifeMaleAge() + public function longestLifeMaleAge(): string { return $this->longlifeQuery('age', 'M'); } @@ -3075,7 +3075,7 @@ class Stats * * @return string */ - public function longestLifeMaleName() + public function longestLifeMaleName(): string { return $this->longlifeQuery('name', 'M'); } @@ -3087,7 +3087,7 @@ class Stats * * @return string */ - public function topTenOldestMale($params = []) + public function topTenOldestMale($params = []): string { return $this->topTenOldestQuery('nolist', 'M', $params); } @@ -3099,7 +3099,7 @@ class Stats * * @return string */ - public function topTenOldestMaleList($params = []) + public function topTenOldestMaleList($params = []): string { return $this->topTenOldestQuery('list', 'M', $params); } @@ -3111,7 +3111,7 @@ class Stats * * @return string */ - public function topTenOldestMaleAlive($params = []) + public function topTenOldestMaleAlive($params = []): string { return $this->topTenOldestAliveQuery('nolist', 'M', $params); } @@ -3123,7 +3123,7 @@ class Stats * * @return string */ - public function topTenOldestMaleListAlive($params = []) + public function topTenOldestMaleListAlive($params = []): string { return $this->topTenOldestAliveQuery('list', 'M', $params); } @@ -3135,7 +3135,7 @@ class Stats * * @return string */ - public function averageLifespanMale($show_years = false) + public function averageLifespanMale($show_years = false): string { return $this->averageLifespanQuery('M', $show_years); } @@ -3149,7 +3149,7 @@ class Stats * * @return string */ - private function eventQuery($type, $direction, $facts) + private function eventQuery($type, $direction, $facts): string { $eventTypes = [ 'BIRT' => I18N::translate('birth'), @@ -3227,7 +3227,7 @@ class Stats * * @return string */ - public function firstEvent() + public function firstEvent(): string { return $this->eventQuery('full', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3237,7 +3237,7 @@ class Stats * * @return string */ - public function firstEventYear() + public function firstEventYear(): string { return $this->eventQuery('year', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3247,7 +3247,7 @@ class Stats * * @return string */ - public function firstEventType() + public function firstEventType(): string { return $this->eventQuery('type', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3257,7 +3257,7 @@ class Stats * * @return string */ - public function firstEventName() + public function firstEventName(): string { return $this->eventQuery('name', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3267,7 +3267,7 @@ class Stats * * @return string */ - public function firstEventPlace() + public function firstEventPlace(): string { return $this->eventQuery('place', 'ASC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3277,7 +3277,7 @@ class Stats * * @return string */ - public function lastEvent() + public function lastEvent(): string { return $this->eventQuery('full', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3287,7 +3287,7 @@ class Stats * * @return string */ - public function lastEventYear() + public function lastEventYear(): string { return $this->eventQuery('year', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3297,7 +3297,7 @@ class Stats * * @return string */ - public function lastEventType() + public function lastEventType(): string { return $this->eventQuery('type', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3307,7 +3307,7 @@ class Stats * * @return string */ - public function lastEventName() + public function lastEventName(): string { return $this->eventQuery('name', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3317,7 +3317,7 @@ class Stats * * @return string */ - public function lastEventPlace() + public function lastEventPlace(): string { return $this->eventQuery('place', 'DESC', WT_EVENTS_BIRT . '|' . WT_EVENTS_MARR . '|' . WT_EVENTS_DIV . '|' . WT_EVENTS_DEAT); } @@ -3332,7 +3332,7 @@ class Stats * * @return string */ - private function marriageQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false) + private function marriageQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false): string { if ($sex == 'F') { $sex_field = 'f_wife'; @@ -3412,7 +3412,7 @@ class Stats * * @return string */ - private function ageOfMarriageQuery($type = 'list', $age_dir = 'ASC', $params = []) + private function ageOfMarriageQuery($type = 'list', $age_dir = 'ASC', $params = []): string { if (isset($params[0])) { $total = (int)$params[0]; @@ -3560,7 +3560,7 @@ class Stats * * @return string */ - private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = []) + private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = []): string { if (isset($params[0])) { $total = (int)$params[0]; @@ -3646,7 +3646,7 @@ class Stats * * @return string */ - private function parentsQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false) + private function parentsQuery($type = 'full', $age_dir = 'ASC', $sex = 'F', $show_years = false): string { if ($sex == 'F') { $sex_field = 'WIFE'; @@ -3914,7 +3914,7 @@ class Stats * * @return string */ - public function firstMarriage() + public function firstMarriage(): string { return $this->mortalityQuery('full', 'ASC', 'MARR'); } @@ -3924,7 +3924,7 @@ class Stats * * @return string */ - public function firstMarriageYear() + public function firstMarriageYear(): string { return $this->mortalityQuery('year', 'ASC', 'MARR'); } @@ -3934,7 +3934,7 @@ class Stats * * @return string */ - public function firstMarriageName() + public function firstMarriageName(): string { return $this->mortalityQuery('name', 'ASC', 'MARR'); } @@ -3944,7 +3944,7 @@ class Stats * * @return string */ - public function firstMarriagePlace() + public function firstMarriagePlace(): string { return $this->mortalityQuery('place', 'ASC', 'MARR'); } @@ -3954,7 +3954,7 @@ class Stats * * @return string */ - public function lastMarriage() + public function lastMarriage(): string { return $this->mortalityQuery('full', 'DESC', 'MARR'); } @@ -3964,7 +3964,7 @@ class Stats * * @return string */ - public function lastMarriageYear() + public function lastMarriageYear(): string { return $this->mortalityQuery('year', 'DESC', 'MARR'); } @@ -3974,7 +3974,7 @@ class Stats * * @return string */ - public function lastMarriageName() + public function lastMarriageName(): string { return $this->mortalityQuery('name', 'DESC', 'MARR'); } @@ -3984,7 +3984,7 @@ class Stats * * @return string */ - public function lastMarriagePlace() + public function lastMarriagePlace(): string { return $this->mortalityQuery('place', 'DESC', 'MARR'); } @@ -3996,7 +3996,7 @@ class Stats * * @return string */ - public function statsMarr($params = []) + public function statsMarr($params = []): string { return $this->statsMarrQuery(true, false, -1, -1, $params); } @@ -4006,7 +4006,7 @@ class Stats * * @return string */ - public function firstDivorce() + public function firstDivorce(): string { return $this->mortalityQuery('full', 'ASC', 'DIV'); } @@ -4016,7 +4016,7 @@ class Stats * * @return string */ - public function firstDivorceYear() + public function firstDivorceYear(): string { return $this->mortalityQuery('year', 'ASC', 'DIV'); } @@ -4026,7 +4026,7 @@ class Stats * * @return string */ - public function firstDivorceName() + public function firstDivorceName(): string { return $this->mortalityQuery('name', 'ASC', 'DIV'); } @@ -4036,7 +4036,7 @@ class Stats * * @return string */ - public function firstDivorcePlace() + public function firstDivorcePlace(): string { return $this->mortalityQuery('place', 'ASC', 'DIV'); } @@ -4046,7 +4046,7 @@ class Stats * * @return string */ - public function lastDivorce() + public function lastDivorce(): string { return $this->mortalityQuery('full', 'DESC', 'DIV'); } @@ -4056,7 +4056,7 @@ class Stats * * @return string */ - public function lastDivorceYear() + public function lastDivorceYear(): string { return $this->mortalityQuery('year', 'DESC', 'DIV'); } @@ -4066,7 +4066,7 @@ class Stats * * @return string */ - public function lastDivorceName() + public function lastDivorceName(): string { return $this->mortalityQuery('name', 'DESC', 'DIV'); } @@ -4076,7 +4076,7 @@ class Stats * * @return string */ - public function lastDivorcePlace() + public function lastDivorcePlace(): string { return $this->mortalityQuery('place', 'DESC', 'DIV'); } @@ -4088,7 +4088,7 @@ class Stats * * @return string */ - public function statsDiv($params = []) + public function statsDiv($params = []): string { return $this->statsDivQuery(true, false, -1, -1, $params); } @@ -4271,7 +4271,7 @@ class Stats * * @return string */ - public function youngestMarriageFemale() + public function youngestMarriageFemale(): string { return $this->marriageQuery('full', 'ASC', 'F', false); } @@ -4281,7 +4281,7 @@ class Stats * * @return string */ - public function youngestMarriageFemaleName() + public function youngestMarriageFemaleName(): string { return $this->marriageQuery('name', 'ASC', 'F', false); } @@ -4293,7 +4293,7 @@ class Stats * * @return string */ - public function youngestMarriageFemaleAge($show_years = false) + public function youngestMarriageFemaleAge($show_years = false): string { return $this->marriageQuery('age', 'ASC', 'F', $show_years); } @@ -4303,7 +4303,7 @@ class Stats * * @return string */ - public function oldestMarriageFemale() + public function oldestMarriageFemale(): string { return $this->marriageQuery('full', 'DESC', 'F', false); } @@ -4313,7 +4313,7 @@ class Stats * * @return string */ - public function oldestMarriageFemaleName() + public function oldestMarriageFemaleName(): string { return $this->marriageQuery('name', 'DESC', 'F', false); } @@ -4325,7 +4325,7 @@ class Stats * * @return string */ - public function oldestMarriageFemaleAge($show_years = false) + public function oldestMarriageFemaleAge($show_years = false): string { return $this->marriageQuery('age', 'DESC', 'F', $show_years); } @@ -4335,7 +4335,7 @@ class Stats * * @return string */ - public function youngestMarriageMale() + public function youngestMarriageMale(): string { return $this->marriageQuery('full', 'ASC', 'M', false); } @@ -4345,7 +4345,7 @@ class Stats * * @return string */ - public function youngestMarriageMaleName() + public function youngestMarriageMaleName(): string { return $this->marriageQuery('name', 'ASC', 'M', false); } @@ -4357,7 +4357,7 @@ class Stats * * @return string */ - public function youngestMarriageMaleAge($show_years = false) + public function youngestMarriageMaleAge($show_years = false): string { return $this->marriageQuery('age', 'ASC', 'M', $show_years); } @@ -4367,7 +4367,7 @@ class Stats * * @return string */ - public function oldestMarriageMale() + public function oldestMarriageMale(): string { return $this->marriageQuery('full', 'DESC', 'M', false); } @@ -4377,7 +4377,7 @@ class Stats * * @return string */ - public function oldestMarriageMaleName() + public function oldestMarriageMaleName(): string { return $this->marriageQuery('name', 'DESC', 'M', false); } @@ -4389,7 +4389,7 @@ class Stats * * @return string */ - public function oldestMarriageMaleAge($show_years = false) + public function oldestMarriageMaleAge($show_years = false): string { return $this->marriageQuery('age', 'DESC', 'M', $show_years); } @@ -4401,7 +4401,7 @@ class Stats * * @return string */ - public function statsMarrAge($params = []) + public function statsMarrAge($params = []): string { return $this->statsMarrAgeQuery(true, 'BOTH', -1, -1, $params); } @@ -4413,7 +4413,7 @@ class Stats * * @return string */ - public function ageBetweenSpousesMF($params = []) + public function ageBetweenSpousesMF($params = []): string { return $this->ageBetweenSpousesQuery('nolist', 'DESC', $params); } @@ -4425,7 +4425,7 @@ class Stats * * @return string */ - public function ageBetweenSpousesMFList($params = []) + public function ageBetweenSpousesMFList($params = []): string { return $this->ageBetweenSpousesQuery('list', 'DESC', $params); } @@ -4437,7 +4437,7 @@ class Stats * * @return string */ - public function ageBetweenSpousesFM($params = []) + public function ageBetweenSpousesFM($params = []): string { return $this->ageBetweenSpousesQuery('nolist', 'ASC', $params); } @@ -4449,7 +4449,7 @@ class Stats * * @return string */ - public function ageBetweenSpousesFMList($params = []) + public function ageBetweenSpousesFMList($params = []): string { return $this->ageBetweenSpousesQuery('list', 'ASC', $params); } @@ -4459,7 +4459,7 @@ class Stats * * @return string */ - public function topAgeOfMarriageFamily() + public function topAgeOfMarriageFamily(): string { return $this->ageOfMarriageQuery('name', 'DESC', ['1']); } @@ -4469,7 +4469,7 @@ class Stats * * @return string */ - public function topAgeOfMarriage() + public function topAgeOfMarriage(): string { return $this->ageOfMarriageQuery('age', 'DESC', ['1']); } @@ -4481,7 +4481,7 @@ class Stats * * @return string */ - public function topAgeOfMarriageFamilies($params = []) + public function topAgeOfMarriageFamilies($params = []): string { return $this->ageOfMarriageQuery('nolist', 'DESC', $params); } @@ -4493,7 +4493,7 @@ class Stats * * @return string */ - public function topAgeOfMarriageFamiliesList($params = []) + public function topAgeOfMarriageFamiliesList($params = []): string { return $this->ageOfMarriageQuery('list', 'DESC', $params); } @@ -4503,7 +4503,7 @@ class Stats * * @return string */ - public function minAgeOfMarriageFamily() + public function minAgeOfMarriageFamily(): string { return $this->ageOfMarriageQuery('name', 'ASC', ['1']); } @@ -4513,7 +4513,7 @@ class Stats * * @return string */ - public function minAgeOfMarriage() + public function minAgeOfMarriage(): string { return $this->ageOfMarriageQuery('age', 'ASC', ['1']); } @@ -4525,7 +4525,7 @@ class Stats * * @return string */ - public function minAgeOfMarriageFamilies($params = []) + public function minAgeOfMarriageFamilies($params = []): string { return $this->ageOfMarriageQuery('nolist', 'ASC', $params); } @@ -4537,7 +4537,7 @@ class Stats * * @return string */ - public function minAgeOfMarriageFamiliesList($params = []) + public function minAgeOfMarriageFamiliesList($params = []): string { return $this->ageOfMarriageQuery('list', 'ASC', $params); } @@ -4547,7 +4547,7 @@ class Stats * * @return string */ - public function youngestMother() + public function youngestMother(): string { return $this->parentsQuery('full', 'ASC', 'F'); } @@ -4557,7 +4557,7 @@ class Stats * * @return string */ - public function youngestMotherName() + public function youngestMotherName(): string { return $this->parentsQuery('name', 'ASC', 'F'); } @@ -4569,7 +4569,7 @@ class Stats * * @return string */ - public function youngestMotherAge($show_years = false) + public function youngestMotherAge($show_years = false): string { return $this->parentsQuery('age', 'ASC', 'F', $show_years); } @@ -4579,7 +4579,7 @@ class Stats * * @return string */ - public function oldestMother() + public function oldestMother(): string { return $this->parentsQuery('full', 'DESC', 'F'); } @@ -4589,7 +4589,7 @@ class Stats * * @return string */ - public function oldestMotherName() + public function oldestMotherName(): string { return $this->parentsQuery('name', 'DESC', 'F'); } @@ -4601,7 +4601,7 @@ class Stats * * @return string */ - public function oldestMotherAge($show_years = false) + public function oldestMotherAge($show_years = false): string { return $this->parentsQuery('age', 'DESC', 'F', $show_years); } @@ -4611,7 +4611,7 @@ class Stats * * @return string */ - public function youngestFather() + public function youngestFather(): string { return $this->parentsQuery('full', 'ASC', 'M'); } @@ -4621,7 +4621,7 @@ class Stats * * @return string */ - public function youngestFatherName() + public function youngestFatherName(): string { return $this->parentsQuery('name', 'ASC', 'M'); } @@ -4633,7 +4633,7 @@ class Stats * * @return string */ - public function youngestFatherAge($show_years = false) + public function youngestFatherAge($show_years = false): string { return $this->parentsQuery('age', 'ASC', 'M', $show_years); } @@ -4643,7 +4643,7 @@ class Stats * * @return string */ - public function oldestFather() + public function oldestFather(): string { return $this->parentsQuery('full', 'DESC', 'M'); } @@ -4653,7 +4653,7 @@ class Stats * * @return string */ - public function oldestFatherName() + public function oldestFatherName(): string { return $this->parentsQuery('name', 'DESC', 'M'); } @@ -4665,7 +4665,7 @@ class Stats * * @return string */ - public function oldestFatherAge($show_years = false) + public function oldestFatherAge($show_years = false): string { return $this->parentsQuery('age', 'DESC', 'M', $show_years); } @@ -4709,7 +4709,7 @@ class Stats * * @return string */ - private function familyQuery($type = 'full') + private function familyQuery($type = 'full'): string { $rows = $this->runSql( " SELECT f_numchil AS tot, f_id AS id" . @@ -4756,7 +4756,7 @@ class Stats * * @return string */ - private function topTenFamilyQuery($type = 'list', $params = []) + private function topTenFamilyQuery($type = 'list', $params = []): string { if (isset($params[0])) { $total = (int)$params[0]; @@ -4823,7 +4823,7 @@ class Stats * * @return string */ - private function ageBetweenSiblingsQuery($type = 'list', $params = []) + private function ageBetweenSiblingsQuery($type = 'list', $params = []): string { if (isset($params[0])) { $total = (int)$params[0]; @@ -5098,7 +5098,7 @@ class Stats * * @return string */ - public function largestFamily() + public function largestFamily(): string { return $this->familyQuery('full'); } @@ -5108,7 +5108,7 @@ class Stats * * @return string */ - public function largestFamilySize() + public function largestFamilySize(): string { return $this->familyQuery('size'); } @@ -5118,7 +5118,7 @@ class Stats * * @return string */ - public function largestFamilyName() + public function largestFamilyName(): string { return $this->familyQuery('name'); } @@ -5130,7 +5130,7 @@ class Stats * * @return string */ - public function topTenLargestFamily($params = []) + public function topTenLargestFamily($params = []): string { return $this->topTenFamilyQuery('nolist', $params); } @@ -5142,7 +5142,7 @@ class Stats * * @return string */ - public function topTenLargestFamilyList($params = []) + public function topTenLargestFamilyList($params = []): string { return $this->topTenFamilyQuery('list', $params); } @@ -5154,7 +5154,7 @@ class Stats * * @return string */ - public function chartLargestFamilies($params = []) + public function chartLargestFamilies($params = []): string { $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); @@ -5221,7 +5221,7 @@ class Stats * * @return string */ - public function totalChildren() + public function totalChildren(): string { $rows = $this->runSql("SELECT SUM(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->getTreeId()}"); @@ -5233,7 +5233,7 @@ class Stats * * @return string */ - public function averageChildren() + public function averageChildren(): string { $rows = $this->runSql("SELECT AVG(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->getTreeId()}"); @@ -5359,7 +5359,7 @@ class Stats * * @return string */ - public function statsChildren($params = []) + public function statsChildren($params = []): string { return $this->statsChildrenQuery(true, 'BOTH', -1, -1, $params); } @@ -5371,7 +5371,7 @@ class Stats * * @return string */ - public function topAgeBetweenSiblingsName($params = []) + public function topAgeBetweenSiblingsName($params = []): string { return $this->ageBetweenSiblingsQuery('name', $params); } @@ -5383,7 +5383,7 @@ class Stats * * @return string */ - public function topAgeBetweenSiblings($params = []) + public function topAgeBetweenSiblings($params = []): string { return $this->ageBetweenSiblingsQuery('age', $params); } @@ -5395,7 +5395,7 @@ class Stats * * @return string */ - public function topAgeBetweenSiblingsFullName($params = []) + public function topAgeBetweenSiblingsFullName($params = []): string { return $this->ageBetweenSiblingsQuery('nolist', $params); } @@ -5407,7 +5407,7 @@ class Stats * * @return string */ - public function topAgeBetweenSiblingsList($params = []) + public function topAgeBetweenSiblingsList($params = []): string { return $this->ageBetweenSiblingsQuery('list', $params); } @@ -5433,7 +5433,7 @@ class Stats * * @return string */ - public function noChildrenFamilies() + public function noChildrenFamilies(): string { return I18N::number($this->noChildrenFamiliesQuery()); } @@ -5445,7 +5445,7 @@ class Stats * * @return string */ - public function noChildrenFamiliesList($params = []) + public function noChildrenFamiliesList($params = []): string { if (isset($params[0]) && $params[0] != '') { $type = strtolower($params[0]); @@ -5505,7 +5505,7 @@ class Stats * * @return string */ - public function chartNoChildrenFamilies($params = []) + public function chartNoChildrenFamilies($params = []): string { if (isset($params[0]) && $params[0] != '') { $size = strtolower($params[0]); @@ -5605,7 +5605,7 @@ class Stats * * @return string */ - private function topTenGrandFamilyQuery($type = 'list', $params = []) + private function topTenGrandFamilyQuery($type = 'list', $params = []): string { if (isset($params[0])) { $total = (int)$params[0]; @@ -5678,7 +5678,7 @@ class Stats * * @return string */ - public function topTenLargestGrandFamily($params = []) + public function topTenLargestGrandFamily($params = []): string { return $this->topTenGrandFamilyQuery('nolist', $params); } @@ -5690,7 +5690,7 @@ class Stats * * @return string */ - public function topTenLargestGrandFamilyList($params = []) + public function topTenLargestGrandFamilyList($params = []): string { return $this->topTenGrandFamilyQuery('list', $params); } @@ -5704,7 +5704,7 @@ class Stats * * @return string */ - private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = []) + private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = []): string { $threshold = empty($params[0]) ? 10 : (int)$params[0]; $number_of_surnames = empty($params[1]) ? 10 : (int)$params[1]; @@ -5769,7 +5769,7 @@ class Stats * * @return string */ - public function getCommonSurname() + public function getCommonSurname(): string { $top_surname = $this->topSurnames(1, 0); @@ -5787,8 +5787,7 @@ class Stats '', '', 'alpha', - ]) - { + ]): string { return $this->commonSurnamesQuery('nolist', false, $params); } @@ -5803,8 +5802,7 @@ class Stats '', '', 'rcount', - ]) - { + ]): string { return $this->commonSurnamesQuery('nolist', true, $params); } @@ -5819,8 +5817,7 @@ class Stats '', '', 'alpha', - ]) - { + ]): string { return $this->commonSurnamesQuery('list', false, $params); } @@ -5835,8 +5832,7 @@ class Stats '', '', 'rcount', - ]) - { + ]): string { return $this->commonSurnamesQuery('list', true, $params); } @@ -5847,7 +5843,7 @@ class Stats * * @return string */ - public function chartCommonSurnames($params = []) + public function chartCommonSurnames($params = []): string { $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); @@ -6042,7 +6038,7 @@ class Stats * * @return string */ - public function commonGiven($params = ['1', '10', 'alpha']) + public function commonGiven($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('B', 'nolist', false, $params); } @@ -6054,7 +6050,7 @@ class Stats * * @return string */ - public function commonGivenTotals($params = ['1', '10', 'rcount']) + public function commonGivenTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('B', 'nolist', true, $params); } @@ -6066,7 +6062,7 @@ class Stats * * @return string */ - public function commonGivenList($params = ['1', '10', 'alpha']) + public function commonGivenList($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('B', 'list', false, $params); } @@ -6078,7 +6074,7 @@ class Stats * * @return string */ - public function commonGivenListTotals($params = ['1', '10', 'rcount']) + public function commonGivenListTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('B', 'list', true, $params); } @@ -6090,7 +6086,7 @@ class Stats * * @return string */ - public function commonGivenTable($params = ['1', '10', 'rcount']) + public function commonGivenTable($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('B', 'table', false, $params); } @@ -6102,7 +6098,7 @@ class Stats * * @return string */ - public function commonGivenFemale($params = ['1', '10', 'alpha']) + public function commonGivenFemale($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('F', 'nolist', false, $params); } @@ -6114,7 +6110,7 @@ class Stats * * @return string */ - public function commonGivenFemaleTotals($params = ['1', '10', 'rcount']) + public function commonGivenFemaleTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('F', 'nolist', true, $params); } @@ -6126,7 +6122,7 @@ class Stats * * @return string */ - public function commonGivenFemaleList($params = ['1', '10', 'alpha']) + public function commonGivenFemaleList($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('F', 'list', false, $params); } @@ -6138,7 +6134,7 @@ class Stats * * @return string */ - public function commonGivenFemaleListTotals($params = ['1', '10', 'rcount']) + public function commonGivenFemaleListTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('F', 'list', true, $params); } @@ -6150,7 +6146,7 @@ class Stats * * @return string */ - public function commonGivenFemaleTable($params = ['1', '10', 'rcount']) + public function commonGivenFemaleTable($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('F', 'table', false, $params); } @@ -6162,7 +6158,7 @@ class Stats * * @return string */ - public function commonGivenMale($params = ['1', '10', 'alpha']) + public function commonGivenMale($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('M', 'nolist', false, $params); } @@ -6174,7 +6170,7 @@ class Stats * * @return string */ - public function commonGivenMaleTotals($params = ['1', '10', 'rcount']) + public function commonGivenMaleTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('M', 'nolist', true, $params); } @@ -6186,7 +6182,7 @@ class Stats * * @return string */ - public function commonGivenMaleList($params = ['1', '10', 'alpha']) + public function commonGivenMaleList($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('M', 'list', false, $params); } @@ -6198,7 +6194,7 @@ class Stats * * @return string */ - public function commonGivenMaleListTotals($params = ['1', '10', 'rcount']) + public function commonGivenMaleListTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('M', 'list', true, $params); } @@ -6210,7 +6206,7 @@ class Stats * * @return string */ - public function commonGivenMaleTable($params = ['1', '10', 'rcount']) + public function commonGivenMaleTable($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('M', 'table', false, $params); } @@ -6222,7 +6218,7 @@ class Stats * * @return string */ - public function commonGivenUnknown($params = ['1', '10', 'alpha']) + public function commonGivenUnknown($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('U', 'nolist', false, $params); } @@ -6234,7 +6230,7 @@ class Stats * * @return string */ - public function commonGivenUnknownTotals($params = ['1', '10', 'rcount']) + public function commonGivenUnknownTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('U', 'nolist', true, $params); } @@ -6246,7 +6242,7 @@ class Stats * * @return string */ - public function commonGivenUnknownList($params = ['1', '10', 'alpha']) + public function commonGivenUnknownList($params = ['1', '10', 'alpha']): string { return $this->commonGivenQuery('U', 'list', false, $params); } @@ -6258,7 +6254,7 @@ class Stats * * @return string */ - public function commonGivenUnknownListTotals($params = ['1', '10', 'rcount']) + public function commonGivenUnknownListTotals($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('U', 'list', true, $params); } @@ -6270,7 +6266,7 @@ class Stats * * @return string */ - public function commonGivenUnknownTable($params = ['1', '10', 'rcount']) + public function commonGivenUnknownTable($params = ['1', '10', 'rcount']): string { return $this->commonGivenQuery('U', 'table', false, $params); } @@ -6282,7 +6278,7 @@ class Stats * * @return string */ - public function chartCommonGiven($params = []) + public function chartCommonGiven($params = []): string { $WT_STATS_CHART_COLOR1 = Theme::theme()->parameter('distribution-chart-no-values'); $WT_STATS_CHART_COLOR2 = Theme::theme()->parameter('distribution-chart-high-values'); @@ -6353,7 +6349,7 @@ class Stats * * @return string */ - private function usersLoggedInQuery($type = 'nolist') + private function usersLoggedInQuery($type = 'nolist'): string { $content = ''; // List active users @@ -6445,7 +6441,7 @@ class Stats * * @return string */ - public function usersLoggedIn() + public function usersLoggedIn(): string { return $this->usersLoggedInQuery('nolist'); } @@ -6455,7 +6451,7 @@ class Stats * * @return string */ - public function usersLoggedInList() + public function usersLoggedInList(): string { return $this->usersLoggedInQuery('list'); } @@ -6465,7 +6461,7 @@ class Stats * * @return int */ - public function usersLoggedInTotal() + public function usersLoggedInTotal(): int { return $this->usersLoggedInTotalQuery('all'); } @@ -6475,7 +6471,7 @@ class Stats * * @return int */ - public function usersLoggedInTotalAnon() + public function usersLoggedInTotalAnon(): int { return $this->usersLoggedInTotalQuery('anon'); } @@ -6485,7 +6481,7 @@ class Stats * * @return int */ - public function usersLoggedInTotalVisible() + public function usersLoggedInTotalVisible(): int { return $this->usersLoggedInTotalQuery('visible'); } @@ -6524,7 +6520,7 @@ class Stats * * @return string */ - public function userFullName() + public function userFullName(): string { return Auth::check() ? '<span dir="auto">' . e(Auth::user()->getRealName()) . '</span>' : ''; } @@ -6592,7 +6588,7 @@ class Stats * * @return string */ - public function latestUserId() + public function latestUserId(): string { return $this->getLatestUserData('userid'); } @@ -6602,7 +6598,7 @@ class Stats * * @return string */ - public function latestUserName() + public function latestUserName(): string { return $this->getLatestUserData('username'); } @@ -6612,7 +6608,7 @@ class Stats * * @return string */ - public function latestUserFullName() + public function latestUserFullName(): string { return $this->getLatestUserData('fullname'); } @@ -6624,7 +6620,7 @@ class Stats * * @return string */ - public function latestUserRegDate($params = []) + public function latestUserRegDate($params = []): string { return $this->getLatestUserData('regdate', $params); } @@ -6636,7 +6632,7 @@ class Stats * * @return string */ - public function latestUserRegTime($params = []) + public function latestUserRegTime($params = []): string { return $this->getLatestUserData('regtime', $params); } @@ -6648,7 +6644,7 @@ class Stats * * @return string */ - public function latestUserLoggedin($params = []) + public function latestUserLoggedin($params = []): string { return $this->getLatestUserData('loggedin', $params); } @@ -6690,7 +6686,7 @@ class Stats * * @return string */ - public function serverDate() + public function serverDate(): string { return FunctionsDate::timestampToGedcomDate(WT_TIMESTAMP)->display(); } @@ -6700,7 +6696,7 @@ class Stats * * @return string */ - public function serverTime() + public function serverTime(): string { return date('g:i a'); } @@ -6710,7 +6706,7 @@ class Stats * * @return string */ - public function serverTime24() + public function serverTime24(): string { return date('G:i'); } @@ -6720,7 +6716,7 @@ class Stats * * @return string */ - public function serverTimezone() + public function serverTimezone(): string { return date('T'); } @@ -6730,7 +6726,7 @@ class Stats * * @return string */ - public function browserDate() + public function browserDate(): string { return FunctionsDate::timestampToGedcomDate(WT_TIMESTAMP + WT_TIMESTAMP_OFFSET)->display(); } @@ -6740,7 +6736,7 @@ class Stats * * @return string */ - public function browserTime() + public function browserTime(): string { return date(str_replace('%', '', I18N::timeFormat()), WT_TIMESTAMP + WT_TIMESTAMP_OFFSET); } @@ -6750,7 +6746,7 @@ class Stats * * @return string */ - public function browserTimezone() + public function browserTimezone(): string { return date('T', WT_TIMESTAMP + WT_TIMESTAMP_OFFSET); } @@ -6760,7 +6756,7 @@ class Stats * * @return string */ - public function webtreesVersion() + public function webtreesVersion(): string { return WT_VERSION; } @@ -6773,7 +6769,7 @@ class Stats * * @return string */ - private function hitCountQuery($page_name, $params) + private function hitCountQuery($page_name, $params): string { if (is_array($params) && isset($params[0]) && $params[0] != '') { $page_parameter = $params[0]; @@ -6790,7 +6786,7 @@ class Stats $user = User::findByIdentifier($page_parameter); $page_parameter = 'user:' . ($user ? $user->getUserId() : Auth::id()); } - + $hit_counter = new PageHitCounter(Auth::user(), $this->tree); return '<span class="odometer">' . I18N::digits($hit_counter->getCount($this->tree, $page_name, $page_parameter)) . '</span>'; @@ -6803,7 +6799,7 @@ class Stats * * @return string */ - public function hitCount($params = []) + public function hitCount($params = []): string { return $this->hitCountQuery('', $params); } @@ -6815,7 +6811,7 @@ class Stats * * @return string */ - public function hitCountUser($params = []) + public function hitCountUser($params = []): string { return $this->hitCountQuery('index.php', $params); } @@ -6827,7 +6823,7 @@ class Stats * * @return string */ - public function hitCountIndi($params = []) + public function hitCountIndi($params = []): string { return $this->hitCountQuery('individual.php', $params); } @@ -6839,7 +6835,7 @@ class Stats * * @return string */ - public function hitCountFam($params = []) + public function hitCountFam($params = []): string { return $this->hitCountQuery('family.php', $params); } @@ -6851,7 +6847,7 @@ class Stats * * @return string */ - public function hitCountSour($params = []) + public function hitCountSour($params = []): string { return $this->hitCountQuery('source.php', $params); } @@ -6863,7 +6859,7 @@ class Stats * * @return string */ - public function hitCountRepo($params = []) + public function hitCountRepo($params = []): string { return $this->hitCountQuery('repo.php', $params); } @@ -6875,7 +6871,7 @@ class Stats * * @return string */ - public function hitCountNote($params = []) + public function hitCountNote($params = []): string { return $this->hitCountQuery('note.php', $params); } @@ -6887,7 +6883,7 @@ class Stats * * @return string */ - public function hitCountObje($params = []) + public function hitCountObje($params = []): string { return $this->hitCountQuery('mediaviewer.php', $params); } @@ -6901,7 +6897,7 @@ class Stats * * @return string */ - private function arrayToExtendedEncoding($a) + private function arrayToExtendedEncoding($a): string { $xencoding = self::GOOGLE_CHART_ENCODING; @@ -6925,7 +6921,7 @@ class Stats * * @return stdClass[] */ - private function runSql($sql) + private function runSql($sql): array { static $cache = []; @@ -7014,7 +7010,7 @@ class Stats * * @return string */ - public function callBlock($params = []) + public function callBlock($params = []): string { global $ctype; @@ -7054,7 +7050,7 @@ class Stats * * @return string */ - public function totalUserMessages() + public function totalUserMessages(): string { $total = (int)Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?") ->execute([Auth::id()]) @@ -7068,7 +7064,7 @@ class Stats * * @return string */ - public function totalUserJournal() + public function totalUserJournal(): string { try { $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") @@ -7089,7 +7085,7 @@ class Stats * * @return string */ - public function totalGedcomNews() + public function totalGedcomNews(): string { try { $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") @@ -7112,7 +7108,7 @@ class Stats * * @return string[] */ - public function iso3166() + public function iso3166(): array { return [ 'ABW' => 'AW', @@ -7367,7 +7363,7 @@ class Stats * * @return string[] */ - public function getAllCountries() + public function getAllCountries(): array { return [ /* I18N: Name of a country or state */ diff --git a/app/SurnameTradition.php b/app/SurnameTradition.php index ad29122e4f..012186d831 100644 --- a/app/SurnameTradition.php +++ b/app/SurnameTradition.php @@ -67,7 +67,7 @@ class SurnameTradition * * @return string[] */ - public static function allDescriptions() + public static function allDescriptions(): array { return [ 'paternal' => I18N::translateContext('Surname tradition', 'paternal') . ' — ' . diff --git a/app/SurnameTradition/DefaultSurnameTradition.php b/app/SurnameTradition/DefaultSurnameTradition.php index 7bfabcb573..f7a23aa36d 100644 --- a/app/SurnameTradition/DefaultSurnameTradition.php +++ b/app/SurnameTradition/DefaultSurnameTradition.php @@ -37,7 +37,7 @@ class DefaultSurnameTradition implements SurnameTraditionInterface * * @return bool */ - public function hasMarriedNames() + public function hasMarriedNames(): bool { return false; } @@ -47,7 +47,7 @@ class DefaultSurnameTradition implements SurnameTraditionInterface * * @return bool */ - public function hasSurnames() + public function hasSurnames(): bool { return true; } diff --git a/app/SurnameTradition/IcelandicSurnameTradition.php b/app/SurnameTradition/IcelandicSurnameTradition.php index 3fe97e9bad..7a4db45c29 100644 --- a/app/SurnameTradition/IcelandicSurnameTradition.php +++ b/app/SurnameTradition/IcelandicSurnameTradition.php @@ -28,7 +28,7 @@ class IcelandicSurnameTradition extends DefaultSurnameTradition implements Surna * * @return bool */ - public function hasSurnames() + public function hasSurnames(): bool { return false; } diff --git a/app/SurnameTradition/PaternalSurnameTradition.php b/app/SurnameTradition/PaternalSurnameTradition.php index 09b6d35a33..ad7ed0931a 100644 --- a/app/SurnameTradition/PaternalSurnameTradition.php +++ b/app/SurnameTradition/PaternalSurnameTradition.php @@ -25,7 +25,7 @@ class PaternalSurnameTradition extends PatrilinealSurnameTradition implements Su * * @return bool */ - public function hasMarriedNames() + public function hasMarriedNames(): bool { return true; } diff --git a/app/SurnameTradition/PatrilinealSurnameTradition.php b/app/SurnameTradition/PatrilinealSurnameTradition.php index 3c5f5b2caa..3ea81da505 100644 --- a/app/SurnameTradition/PatrilinealSurnameTradition.php +++ b/app/SurnameTradition/PatrilinealSurnameTradition.php @@ -73,7 +73,7 @@ class PatrilinealSurnameTradition extends DefaultSurnameTradition implements Sur * * @return string An inflected name */ - protected function inflect($name, $inflections) + protected function inflect($name, $inflections): string { foreach ($inflections as $from => $to) { $name = preg_replace('~' . $from . '~u', $to, $name); diff --git a/app/SurnameTradition/SurnameTraditionInterface.php b/app/SurnameTradition/SurnameTraditionInterface.php index f82fdf4d21..1015c1c2a7 100644 --- a/app/SurnameTradition/SurnameTraditionInterface.php +++ b/app/SurnameTradition/SurnameTraditionInterface.php @@ -26,14 +26,14 @@ interface SurnameTraditionInterface * * @return bool */ - public function hasMarriedNames(); + public function hasMarriedNames(): bool; /** * Does this surname tradition use surnames? * * @return bool */ - public function hasSurnames(); + public function hasSurnames(): bool; /** * What names are given to a new child diff --git a/app/Theme.php b/app/Theme.php index 30d549f650..a8df2f4862 100644 --- a/app/Theme.php +++ b/app/Theme.php @@ -35,7 +35,7 @@ class Theme * * @return ThemeInterface[] */ - public static function installedThemes() + public static function installedThemes(): array { if (self::$installed_themes === null) { self::$installed_themes = []; @@ -62,7 +62,7 @@ class Theme * * @return string[] */ - public static function themeNames() + public static function themeNames(): array { $theme_names = []; foreach (self::installedThemes() as $theme) { @@ -79,7 +79,7 @@ class Theme * * @return ThemeInterface */ - public static function theme(ThemeInterface $theme = null) + public static function theme(ThemeInterface $theme = null): ThemeInterface { if ($theme) { self::$theme = $theme; diff --git a/app/Theme/AbstractTheme.php b/app/Theme/AbstractTheme.php index 4bc4abe345..237a9c7057 100644 --- a/app/Theme/AbstractTheme.php +++ b/app/Theme/AbstractTheme.php @@ -135,7 +135,7 @@ abstract class AbstractTheme * * @return string */ - public function accessibilityLinks() + public function accessibilityLinks(): string { return '<div class="wt-accessibility-links">' . @@ -184,7 +184,7 @@ abstract class AbstractTheme * * @return string */ - public function analyticsBingWebmaster($verification_id) + public function analyticsBingWebmaster($verification_id): string { return '<meta name="msvalidate.01" content="' . $verification_id . '">'; } @@ -196,7 +196,7 @@ abstract class AbstractTheme * * @return string */ - public function analyticsGoogleWebmaster($verification_id) + public function analyticsGoogleWebmaster($verification_id): string { return '<meta name="google-site-verification" content="' . $verification_id . '">'; } @@ -292,7 +292,7 @@ abstract class AbstractTheme * * @return string A relative path, such as "themes/foo/" */ - public function assetUrl() + public function assetUrl(): string { return self::ASSET_DIR; } @@ -331,7 +331,7 @@ abstract class AbstractTheme * * @return string */ - public function contactLinkEverything(User $user) + public function contactLinkEverything(User $user): string { return I18N::translate('For technical support or genealogy questions contact %s.', $this->contactLink($user)); } @@ -343,7 +343,7 @@ abstract class AbstractTheme * * @return string */ - public function contactLinkGenealogy(User $user) + public function contactLinkGenealogy(User $user): string { return I18N::translate('For help with genealogy questions contact %s.', $this->contactLink($user)); } @@ -355,7 +355,7 @@ abstract class AbstractTheme * * @return string */ - public function contactLinkTechnical(User $user) + public function contactLinkTechnical(User $user): string { return I18N::translate('For technical support and information contact %s.', $this->contactLink($user)); } @@ -411,7 +411,7 @@ abstract class AbstractTheme * * @return string */ - public function doctype() + public function doctype(): string { return '<!DOCTYPE html>'; } @@ -421,7 +421,7 @@ abstract class AbstractTheme * * @return string */ - protected function favicon() + protected function favicon(): string { return '<link rel="icon" href="' . self::ASSET_DIR . 'favicon.png" type="image/png">' . @@ -436,7 +436,7 @@ abstract class AbstractTheme * * @return string */ - protected function flashMessageContainer(stdClass $message) + protected function flashMessageContainer(stdClass $message): string { return $this->htmlAlert($message->text, $message->status, true); } @@ -518,7 +518,7 @@ abstract class AbstractTheme * * @return string */ - protected function formQuickSearchFields() + protected function formQuickSearchFields(): string { return '<div class="input-group">' . @@ -549,7 +549,7 @@ abstract class AbstractTheme * * @return string */ - public function formatSecondaryMenu() + public function formatSecondaryMenu(): string { return '<ul class="nav wt-secondary-menu">' . @@ -566,7 +566,7 @@ abstract class AbstractTheme * * @return string */ - public function formatSecondaryMenuItem(Menu $menu) + public function formatSecondaryMenuItem(Menu $menu): string { return $menu->bootstrap4(); } @@ -576,7 +576,7 @@ abstract class AbstractTheme * * @return string */ - protected function headerContent() + protected function headerContent(): string { return $this->accessibilityLinks() . @@ -603,7 +603,7 @@ abstract class AbstractTheme * * @return string */ - public function hookHeaderExtraContent() + public function hookHeaderExtraContent(): string { return ''; } @@ -613,7 +613,7 @@ abstract class AbstractTheme * * @return string */ - public function html() + public function html(): string { return '<html ' . I18N::htmlAttributes() . '>'; } @@ -704,7 +704,7 @@ abstract class AbstractTheme * * @return string */ - public function individualBox(Individual $individual) + public function individualBox(Individual $individual): string { $person_box_class = self::PERSON_BOX_CLASSES[$individual->getSex()]; @@ -747,7 +747,7 @@ abstract class AbstractTheme * * @return string */ - public function individualBoxEmpty() + public function individualBoxEmpty(): string { return '<div class="person_box_template person_boxNN box-style1" style="width: ' . $this->parameter('chart-box-x') . 'px; min-height: ' . $this->parameter('chart-box-y') . 'px"></div>'; } @@ -759,7 +759,7 @@ abstract class AbstractTheme * * @return string */ - public function individualBoxLarge(Individual $individual) + public function individualBoxLarge(Individual $individual): string { $person_box_class = self::PERSON_BOX_CLASSES[$individual->getSex()]; @@ -804,7 +804,7 @@ abstract class AbstractTheme * * @return string */ - public function individualBoxSmall(Individual $individual) + public function individualBoxSmall(Individual $individual): string { $person_box_class = self::PERSON_BOX_CLASSES[$individual->getSex()]; @@ -832,7 +832,7 @@ abstract class AbstractTheme * * @return string */ - public function individualBoxSmallEmpty() + public function individualBoxSmallEmpty(): string { return '<div class="person_box_template person_boxNN box-style1" style="width: ' . $this->parameter('compact-chart-box-x') . 'px; min-height: ' . $this->parameter('compact-chart-box-y') . 'px"></div>'; } @@ -844,7 +844,7 @@ abstract class AbstractTheme * * @return string */ - public function individualBoxFacts(Individual $individual) + public function individualBoxFacts(Individual $individual): string { $html = ''; @@ -925,7 +925,7 @@ abstract class AbstractTheme * * @return Menu[] */ - public function individualBoxMenu(Individual $individual) + public function individualBoxMenu(Individual $individual): array { $menus = array_merge( $this->individualBoxMenuCharts($individual), @@ -942,7 +942,7 @@ abstract class AbstractTheme * * @return Menu[] */ - public function individualBoxMenuCharts(Individual $individual) + public function individualBoxMenuCharts(Individual $individual): array { $menus = []; foreach (Module::getActiveCharts($this->tree) as $chart) { @@ -966,7 +966,7 @@ abstract class AbstractTheme * * @return Menu[] */ - public function individualBoxMenuFamilyLinks(Individual $individual) + public function individualBoxMenuFamilyLinks(Individual $individual): array { $menus = []; @@ -1024,7 +1024,7 @@ abstract class AbstractTheme * * @return string */ - protected function logoHeader() + protected function logoHeader(): string { return '<div class="col wt-site-logo"></div>'; } @@ -1034,7 +1034,7 @@ abstract class AbstractTheme * * @return string */ - public function logoPoweredBy() + public function logoPoweredBy(): string { return '<a href="' . WT_WEBTREES_URL . '" class="wt-powered-by-webtrees" title="' . WT_WEBTREES_URL . '" dir="ltr">' . WT_WEBTREES_URL . '</a>'; } @@ -1044,7 +1044,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuCalendar() + public function menuCalendar(): Menu { return new Menu(I18N::translate('Calendar'), '#', 'menu-calendar', ['rel' => 'nofollow'], [ // Day view @@ -1458,7 +1458,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuLists($surname) + public function menuLists($surname): Menu { // Do not show empty lists $row = Database::prepare( @@ -1507,7 +1507,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuListsBranches($surname) + public function menuListsBranches($surname): Menu { return new Menu(I18N::translate('Branches'), route('branches', [ 'ged' => $this->tree->getName(), @@ -1522,7 +1522,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuListsFamilies($surname) + public function menuListsFamilies($surname): Menu { return new Menu(I18N::translate('Families'), route('family-list', [ 'ged' => $this->tree->getName(), @@ -1537,7 +1537,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuListsIndividuals($surname) + public function menuListsIndividuals($surname): Menu { return new Menu(I18N::translate('Individuals'), route('individual-list', [ 'ged' => $this->tree->getName(), @@ -1550,7 +1550,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuListsMedia() + public function menuListsMedia(): Menu { return new Menu(I18N::translate('Media objects'), route('media-list', ['ged' => $this->tree->getName()]), 'menu-list-obje', ['rel' => 'nofollow']); } @@ -1560,7 +1560,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuListsNotes() + public function menuListsNotes(): Menu { return new Menu(I18N::translate('Shared notes'), route('note-list', ['ged' => $this->tree->getName()]), 'menu-list-note', ['rel' => 'nofollow']); } @@ -1570,7 +1570,7 @@ abstract class AbstractTheme * * @return Menu */ - protected function menuListsPlaces() + protected function menuListsPlaces(): Menu { return new Menu(I18N::translate('Place hierarchy'), route('place-hierarchy', ['ged' => $this->tree->getName()]), 'menu-list-plac', ['rel' => 'nofollow']); } @@ -1580,7 +1580,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuListsRepositories() + public function menuListsRepositories(): Menu { return new Menu(I18N::translate('Repositories'), route('repository-list', ['ged' => $this->tree->getName()]), 'menu-list-repo', ['rel' => 'nofollow']); } @@ -1590,7 +1590,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuListsSources() + public function menuListsSources(): Menu { return new Menu(I18N::translate('Sources'), route('source-list', ['ged' => $this->tree->getName()]), 'menu-list-sour', ['rel' => 'nofollow']); } @@ -1633,7 +1633,7 @@ abstract class AbstractTheme * * @return Menu[] */ - public function menuModules() + public function menuModules(): array { $menus = []; foreach (Module::getActiveMenus($this->tree) as $module) { @@ -1678,7 +1678,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuMyPage() + public function menuMyPage(): Menu { return new Menu(I18N::translate('My page'), route('user-page'), 'menu-mypage'); } @@ -1770,7 +1770,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuSearch() + public function menuSearch(): Menu { return new Menu(I18N::translate('Search'), '#', 'menu-search', ['rel' => 'nofollow'], array_filter([ $this->menuSearchGeneral(), @@ -1785,7 +1785,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuSearchGeneral() + public function menuSearchGeneral(): Menu { return new Menu(I18N::translate('General search'), route('search-general', ['ged' => $this->tree->getName()]), 'menu-search-general', ['rel' => 'nofollow']); } @@ -1795,7 +1795,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuSearchPhonetic() + public function menuSearchPhonetic(): Menu { /* I18N: search using “sounds like”, rather than exact spelling */ return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex',]), 'menu-search-soundex', ['rel' => 'nofollow']); @@ -1806,7 +1806,7 @@ abstract class AbstractTheme * * @return Menu */ - public function menuSearchAdvanced() + public function menuSearchAdvanced(): Menu { return new Menu(I18N::translate('Advanced search'), route('search-advanced', ['ged' => $this->tree->getName()]), 'menu-search-advanced', ['rel' => 'nofollow']); } @@ -1862,7 +1862,7 @@ abstract class AbstractTheme * * @return string */ - protected function metaCharset() + protected function metaCharset(): string { return '<meta charset="UTF-8">'; } @@ -1872,7 +1872,7 @@ abstract class AbstractTheme * * @return string */ - protected function metaCsrf() + protected function metaCsrf(): string { return '<meta name="csrf" content="' . e(Session::getCsrfToken()) . '">'; } @@ -1930,7 +1930,7 @@ abstract class AbstractTheme * * @return string */ - protected function metaViewport() + protected function metaViewport(): string { return '<meta name="viewport" content="width=device-width, initial-scale=1">'; } @@ -1989,7 +1989,7 @@ abstract class AbstractTheme * * @return bool */ - public function pendingChangesExist() + public function pendingChangesExist(): bool { return $this->tree && $this->tree->hasPendingEdit() && Auth::isModerator($this->tree); } @@ -1999,7 +1999,7 @@ abstract class AbstractTheme * * @return string */ - public function pendingChangesLink() + public function pendingChangesLink(): string { return '<a href="' . e(route('show-pending', ['ged' => $this->tree->getName()])) . '">' . $this->pendingChangesLinkText() . '</a>'; } @@ -2009,7 +2009,7 @@ abstract class AbstractTheme * * @return string */ - public function pendingChangesLinkText() + public function pendingChangesLinkText(): string { return I18N::translate('There are pending changes for you to moderate.'); } @@ -2021,7 +2021,7 @@ abstract class AbstractTheme * * @return Menu[] */ - public function primaryMenu(Individual $individual) + public function primaryMenu(Individual $individual): array { $surname = $individual->getAllNames()[0]['surn']; @@ -2042,7 +2042,7 @@ abstract class AbstractTheme * * @return string */ - protected function primaryMenuContainer(array $menus) + protected function primaryMenuContainer(array $menus): string { return '<nav class="col wt-primary-navigation"><ul class="nav wt-primary-menu">' . $this->primaryMenuContent($menus) . '</ul></nav>'; } @@ -2054,7 +2054,7 @@ abstract class AbstractTheme * * @return string */ - public function primaryMenuContent(array $menus) + public function primaryMenuContent(array $menus): string { return implode('', array_map(function (Menu $menu) { return $menu->bootstrap4(); @@ -2066,7 +2066,7 @@ abstract class AbstractTheme * * @return Menu[] */ - public function secondaryMenu() + public function secondaryMenu(): array { return array_filter([ $this->menuPendingChanges(), @@ -2086,7 +2086,7 @@ abstract class AbstractTheme * * @return string */ - protected function secondaryMenuContainer(array $menus) + protected function secondaryMenuContainer(array $menus): string { return '<div class="col wt-secondary-navigation"><ul class="nav wt-secondary-menu">' . $this->secondaryMenuContent($menus) . '</ul></div>'; } @@ -2098,7 +2098,7 @@ abstract class AbstractTheme * * @return string */ - public function secondaryMenuContent(array $menus) + public function secondaryMenuContent(array $menus): string { return implode('', array_map(function (Menu $menu) { return $menu->bootstrap4(); @@ -2110,7 +2110,7 @@ abstract class AbstractTheme * * @return string[] */ - public function stylesheets() + public function stylesheets(): array { return [ self::STYLESHEET, @@ -2122,7 +2122,7 @@ abstract class AbstractTheme * * @return string */ - public function themeId() + public function themeId(): string { return static::THEME_DIR; } @@ -2132,7 +2132,7 @@ abstract class AbstractTheme * * @return string */ - abstract public function themeName(); + abstract public function themeName(): string; /** * Create the <title> tag. @@ -2141,7 +2141,7 @@ abstract class AbstractTheme * * @return string */ - protected function title($title) + protected function title($title): string { return '<title>' . e($title) . '</title>'; } diff --git a/app/Theme/CloudsTheme.php b/app/Theme/CloudsTheme.php index 07e2a6dbd6..d39333849a 100644 --- a/app/Theme/CloudsTheme.php +++ b/app/Theme/CloudsTheme.php @@ -64,7 +64,7 @@ class CloudsTheme extends AbstractTheme implements ThemeInterface * * @return Menu[] */ - public function primaryMenu(Individual $individual) + public function primaryMenu(Individual $individual): array { $primary_menu = parent::primaryMenu($individual); @@ -86,7 +86,7 @@ class CloudsTheme extends AbstractTheme implements ThemeInterface * * @return string[] */ - public function stylesheets() + public function stylesheets(): array { return array_merge(parent::stylesheets(), [ self::STYLESHEET, @@ -98,7 +98,7 @@ class CloudsTheme extends AbstractTheme implements ThemeInterface * * @return string */ - public function themeName() + public function themeName(): string { /* I18N: Name of a theme. */ return I18N::translate('clouds'); diff --git a/app/Theme/ColorsTheme.php b/app/Theme/ColorsTheme.php index 1cc751136c..63544f747c 100644 --- a/app/Theme/ColorsTheme.php +++ b/app/Theme/ColorsTheme.php @@ -115,7 +115,7 @@ class ColorsTheme extends CloudsTheme implements ThemeInterface * * @return Menu[] */ - public function secondaryMenu() + public function secondaryMenu(): array { return array_filter([ $this->menuPendingChanges(), @@ -162,7 +162,7 @@ class ColorsTheme extends CloudsTheme implements ThemeInterface * * @return string[] */ - public function stylesheets() + public function stylesheets(): array { return array_merge(parent::stylesheets(), [ 'themes/colors/css-2.0.0/style.css', @@ -175,7 +175,7 @@ class ColorsTheme extends CloudsTheme implements ThemeInterface * * @return string */ - public function themeName() + public function themeName(): string { /* I18N: Name of a theme. */ return I18N::translate('colors'); diff --git a/app/Theme/FabTheme.php b/app/Theme/FabTheme.php index 0d37587c03..7f47345a02 100644 --- a/app/Theme/FabTheme.php +++ b/app/Theme/FabTheme.php @@ -35,7 +35,7 @@ class FabTheme extends AbstractTheme implements ThemeInterface * * @return string */ - public function formatSecondaryMenu() + public function formatSecondaryMenu(): string { return '<ul class="nav wt-secondary-menu justify-content-end">' . @@ -53,7 +53,7 @@ class FabTheme extends AbstractTheme implements ThemeInterface * * @return string */ - public function formQuickSearchFields() + public function formQuickSearchFields(): string { return '<input type="search" name="query" size="20" placeholder="' . I18N::translate('Search') . '">'; @@ -89,7 +89,7 @@ class FabTheme extends AbstractTheme implements ThemeInterface * * @return string[] */ - public function stylesheets() + public function stylesheets(): array { return array_merge(parent::stylesheets(), [ self::STYLESHEET, @@ -101,7 +101,7 @@ class FabTheme extends AbstractTheme implements ThemeInterface * * @return string */ - public function themeName() + public function themeName(): string { /* I18N: Name of a theme. */ return I18N::translate('F.A.B.'); diff --git a/app/Theme/MinimalTheme.php b/app/Theme/MinimalTheme.php index 203b26578a..8944432d96 100644 --- a/app/Theme/MinimalTheme.php +++ b/app/Theme/MinimalTheme.php @@ -59,7 +59,7 @@ class MinimalTheme extends AbstractTheme implements ThemeInterface * * @return string[] */ - public function stylesheets() + public function stylesheets(): array { return array_merge(parent::stylesheets(), [ self::STYLESHEET, @@ -71,7 +71,7 @@ class MinimalTheme extends AbstractTheme implements ThemeInterface * * @return string */ - public function themeName() + public function themeName(): string { /* I18N: Name of a theme. */ return I18N::translate('minimal'); diff --git a/app/Theme/ThemeInterface.php b/app/Theme/ThemeInterface.php index 7ab23e42d0..bae725abec 100644 --- a/app/Theme/ThemeInterface.php +++ b/app/Theme/ThemeInterface.php @@ -34,7 +34,7 @@ interface ThemeInterface * * @return string */ - public function contactLink(User $user); + public function contactLink(User $user): string; /** * Display an icon for this fact. @@ -43,7 +43,7 @@ interface ThemeInterface * * @return string */ - public function icon(Fact $fact); + public function icon(Fact $fact): string; /** * Display an individual in a box - for charts, etc. @@ -52,14 +52,14 @@ interface ThemeInterface * * @return string */ - public function individualBox(Individual $individual); + public function individualBox(Individual $individual): string; /** * Display an empty box - for a missing individual in a chart. * * @return string */ - public function individualBoxEmpty(); + public function individualBoxEmpty(): string; /** * Display an individual in a box - for charts, etc. @@ -68,7 +68,7 @@ interface ThemeInterface * * @return string */ - public function individualBoxLarge(Individual $individual); + public function individualBoxLarge(Individual $individual): string; /** * Display an individual in a box - for charts, etc. @@ -77,14 +77,14 @@ interface ThemeInterface * * @return string */ - public function individualBoxSmall(Individual $individual); + public function individualBoxSmall(Individual $individual): string; /** * Display an individual in a box - for charts, etc. * * @return string */ - public function individualBoxSmallEmpty(); + public function individualBoxSmallEmpty(): string; /** * Initialise the theme. We cannot pass these in a constructor, as the construction @@ -104,7 +104,7 @@ interface ThemeInterface * * @return Menu[] */ - public function individualBoxMenu(Individual $individual); + public function individualBoxMenu(Individual $individual): array; /** * Misecellaneous dimensions, fonts, styles, etc. @@ -120,12 +120,12 @@ interface ThemeInterface * * @return string */ - public function themeId(); + public function themeId(): string; /** * What is this theme called? * * @return string */ - public function themeName(); + public function themeName(): string; } diff --git a/app/Theme/WebtreesTheme.php b/app/Theme/WebtreesTheme.php index dccd28aa60..13eb4c44b9 100644 --- a/app/Theme/WebtreesTheme.php +++ b/app/Theme/WebtreesTheme.php @@ -59,7 +59,7 @@ class WebtreesTheme extends AbstractTheme implements ThemeInterface * * @return string[] */ - public function stylesheets() + public function stylesheets(): array { return array_merge(parent::stylesheets(), [ self::STYLESHEET, @@ -71,7 +71,7 @@ class WebtreesTheme extends AbstractTheme implements ThemeInterface * * @return string */ - public function themeName() + public function themeName(): string { return I18N::translate('webtrees'); } diff --git a/app/Theme/XeneaTheme.php b/app/Theme/XeneaTheme.php index 2897ddd69f..410970379a 100644 --- a/app/Theme/XeneaTheme.php +++ b/app/Theme/XeneaTheme.php @@ -59,7 +59,7 @@ class XeneaTheme extends AbstractTheme implements ThemeInterface * * @return string[] */ - public function stylesheets() + public function stylesheets(): array { return array_merge(parent::stylesheets(), [ self::STYLESHEET, @@ -71,7 +71,7 @@ class XeneaTheme extends AbstractTheme implements ThemeInterface * * @return string */ - public function themeName() + public function themeName(): string { /* I18N: Name of a theme. */ return I18N::translate('xenea'); diff --git a/app/Tree.php b/app/Tree.php index 241d40b558..e6e7857062 100644 --- a/app/Tree.php +++ b/app/Tree.php @@ -99,7 +99,7 @@ class Tree * * @return int */ - public function getTreeId() + public function getTreeId(): int { return $this->tree_id; } @@ -109,7 +109,7 @@ class Tree * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -119,7 +119,7 @@ class Tree * * @return string */ - public function getTitle() + public function getTitle(): string { return $this->title; } @@ -129,7 +129,7 @@ class Tree * * @return int[] */ - public function getFactPrivacy() + public function getFactPrivacy(): array { return $this->fact_privacy; } @@ -139,7 +139,7 @@ class Tree * * @return int[] */ - public function getIndividualPrivacy() + public function getIndividualPrivacy(): array { return $this->individual_privacy; } @@ -149,7 +149,7 @@ class Tree * * @return int[][] */ - public function getIndividualFactPrivacy() + public function getIndividualFactPrivacy(): array { return $this->individual_fact_privacy; } diff --git a/app/User.php b/app/User.php index 138780e6bd..5682453eef 100644 --- a/app/User.php +++ b/app/User.php @@ -67,7 +67,7 @@ class User * * @return User */ - public static function create($user_name, $real_name, $email, $password) + public static function create($user_name, $real_name, $email, $password): User { Database::prepare( "INSERT INTO `##user` (user_name, real_name, email, password) VALUES (:user_name, :real_name, :email, :password)" @@ -401,7 +401,7 @@ class User * * @return string */ - public function getUserName() + public function getUserName(): string { return $this->user_name; } @@ -413,7 +413,7 @@ class User * * @return $this */ - public function setUserName($user_name) + public function setUserName($user_name): self { if ($this->user_name !== $user_name) { $this->user_name = $user_name; @@ -433,7 +433,7 @@ class User * * @return string */ - public function getRealName() + public function getRealName(): string { return $this->real_name; } @@ -445,7 +445,7 @@ class User * * @return User */ - public function setRealName($real_name) + public function setRealName($real_name): User { if ($this->real_name !== $real_name) { $this->real_name = $real_name; @@ -465,7 +465,7 @@ class User * * @return string */ - public function getEmail() + public function getEmail(): string { return $this->email; } @@ -477,7 +477,7 @@ class User * * @return User */ - public function setEmail($email) + public function setEmail($email): User { if ($this->email !== $email) { $this->email = $email; @@ -499,7 +499,7 @@ class User * * @return User */ - public function setPassword($password) + public function setPassword($password): User { Database::prepare( "UPDATE `##user` SET password = :password WHERE user_id = :user_id" @@ -521,7 +521,7 @@ class User * * @return string */ - public function getPreference($setting_name, $default = '') + public function getPreference($setting_name, $default = ''): string { if (empty($this->preferences) && $this->user_id !== 0) { $this->preferences = Database::prepare( @@ -548,7 +548,7 @@ class User * * @return User */ - public function setPreference($setting_name, $setting_value) + public function setPreference($setting_name, $setting_value): User { if ($this->user_id !== 0 && $this->getPreference($setting_name) !== $setting_value) { Database::prepare( diff --git a/app/View.php b/app/View.php index 26f9ce6138..25ef4f59f8 100644 --- a/app/View.php +++ b/app/View.php @@ -118,7 +118,7 @@ class View * * @return string */ - public function render() + public function render(): string { extract($this->data + self::$shared_data); @@ -137,7 +137,7 @@ class View * @return string * @throws Exception */ - public function getFilenameForView($view_name) + public function getFilenameForView($view_name): string { foreach ($this->paths() as $path) { $view_file = $path . '/' . $view_name . '.php'; @@ -158,7 +158,7 @@ class View * * @return string */ - public static function make($name, $data = []) + public static function make($name, $data = []): string { $view = new static($name, $data); diff --git a/tests/app/Census/CensusColumnBirthPlaceSimpleTest.php b/tests/app/Census/CensusColumnBirthPlaceSimpleTest.php index de3f649855..e455c8ed3b 100644 --- a/tests/app/Census/CensusColumnBirthPlaceSimpleTest.php +++ b/tests/app/Census/CensusColumnBirthPlaceSimpleTest.php @@ -38,7 +38,7 @@ class CensusColumnBirthPlaceSimpleTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeMock = Mockery::mock('\Fisharebest\Webtrees\Place'); $placeMock->shouldReceive('getGedcomName')->andReturn($place); diff --git a/tests/app/Census/CensusColumnBirthPlaceTest.php b/tests/app/Census/CensusColumnBirthPlaceTest.php index f5615e9fd6..0351940407 100644 --- a/tests/app/Census/CensusColumnBirthPlaceTest.php +++ b/tests/app/Census/CensusColumnBirthPlaceTest.php @@ -38,7 +38,7 @@ class CensusColumnBirthPlaceTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeMock = Mockery::mock('\Fisharebest\Webtrees\Place'); $placeMock->shouldReceive('getGedcomName')->andReturn($place); diff --git a/tests/app/Census/CensusColumnBornForeignPartsTest.php b/tests/app/Census/CensusColumnBornForeignPartsTest.php index 03afe01c0d..ad8dc18f0e 100644 --- a/tests/app/Census/CensusColumnBornForeignPartsTest.php +++ b/tests/app/Census/CensusColumnBornForeignPartsTest.php @@ -38,7 +38,7 @@ class CensusColumnBornForeignPartsTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeParts = explode(', ', $place); diff --git a/tests/app/Census/CensusColumnFatherBirthPlaceSimpleTest.php b/tests/app/Census/CensusColumnFatherBirthPlaceSimpleTest.php index c4ebcafccc..3e184a382f 100644 --- a/tests/app/Census/CensusColumnFatherBirthPlaceSimpleTest.php +++ b/tests/app/Census/CensusColumnFatherBirthPlaceSimpleTest.php @@ -38,7 +38,7 @@ class CensusColumnFatherBirthPlaceSimpleTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeParts = explode(', ', $place); diff --git a/tests/app/Census/CensusColumnFatherBirthPlaceTest.php b/tests/app/Census/CensusColumnFatherBirthPlaceTest.php index 94fde273fc..e7d5fb4ee2 100644 --- a/tests/app/Census/CensusColumnFatherBirthPlaceTest.php +++ b/tests/app/Census/CensusColumnFatherBirthPlaceTest.php @@ -38,7 +38,7 @@ class CensusColumnFatherBirthPlaceTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeParts = explode(', ', $place); diff --git a/tests/app/Census/CensusColumnFatherForeignTest.php b/tests/app/Census/CensusColumnFatherForeignTest.php index aaee42f282..cdb9bb198f 100644 --- a/tests/app/Census/CensusColumnFatherForeignTest.php +++ b/tests/app/Census/CensusColumnFatherForeignTest.php @@ -38,7 +38,7 @@ class CensusColumnFatherForeignTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeMock = Mockery::mock('\Fisharebest\Webtrees\Place'); $placeMock->shouldReceive('getGedcomName')->andReturn($place); diff --git a/tests/app/Census/CensusColumnMotherBirthPlaceSimpleTest.php b/tests/app/Census/CensusColumnMotherBirthPlaceSimpleTest.php index a7554aca86..4536671131 100644 --- a/tests/app/Census/CensusColumnMotherBirthPlaceSimpleTest.php +++ b/tests/app/Census/CensusColumnMotherBirthPlaceSimpleTest.php @@ -38,7 +38,7 @@ class CensusColumnMotherBirthPlaceSimpleTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeParts = explode(', ', $place); diff --git a/tests/app/Census/CensusColumnMotherBirthPlaceTest.php b/tests/app/Census/CensusColumnMotherBirthPlaceTest.php index c6ad42f4bd..cdd379643a 100644 --- a/tests/app/Census/CensusColumnMotherBirthPlaceTest.php +++ b/tests/app/Census/CensusColumnMotherBirthPlaceTest.php @@ -38,7 +38,7 @@ class CensusColumnMotherBirthPlaceTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeParts = explode(', ', $place); diff --git a/tests/app/Census/CensusColumnMotherForeignTest.php b/tests/app/Census/CensusColumnMotherForeignTest.php index 3354adaf69..9814c6bf59 100644 --- a/tests/app/Census/CensusColumnMotherForeignTest.php +++ b/tests/app/Census/CensusColumnMotherForeignTest.php @@ -38,7 +38,7 @@ class CensusColumnMotherForeignTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeMock = Mockery::mock('\Fisharebest\Webtrees\Place'); $placeMock->shouldReceive('getGedcomName')->andReturn($place); diff --git a/tests/app/Census/CensusColumnNationalityTest.php b/tests/app/Census/CensusColumnNationalityTest.php index 55d4942f21..292cf33624 100644 --- a/tests/app/Census/CensusColumnNationalityTest.php +++ b/tests/app/Census/CensusColumnNationalityTest.php @@ -39,7 +39,7 @@ class CensusColumnNationalityTest extends \PHPUnit\Framework\TestCase * * @return \Fisharebest\Webtrees\Place */ - private function getPlaceMock($place) + private function getPlaceMock($place): \Fisharebest\Webtrees\Place { $placeMock = Mockery::mock('\Fisharebest\Webtrees\Place'); $placeMock->shouldReceive('getGedcomName')->andReturn($place); |
