@@ -48,7 +48,7 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | class RestrictionNotice extends AbstractElement |
| 50 | 50 | { |
| 51 | - public const string VALUE_NONE = 'NONE'; |
|
| 51 | + public const string VALUE_NONE = 'NONE'; |
|
| 52 | 52 | public const string VALUE_PRIVACY = 'PRIVACY'; |
| 53 | 53 | public const string VALUE_CONFIDENTIAL = 'CONFIDENTIAL'; |
| 54 | 54 | public const string VALUE_LOCKED = 'LOCKED'; |
@@ -35,10 +35,10 @@ |
||
| 35 | 35 | { |
| 36 | 36 | // Delete old thumbnails after 90 days. |
| 37 | 37 | private const string THUMBNAIL_DIR = 'thumbnail-cache'; |
| 38 | - private const int MAX_THUMBNAIL_AGE = 60 * 60 * 24 * 90; |
|
| 38 | + private const int MAX_THUMBNAIL_AGE = 60 * 60 * 24 * 90; |
|
| 39 | 39 | |
| 40 | 40 | // Delete files in /data/tmp after 1 hour. |
| 41 | - private const string TMP_DIR = 'data/tmp'; |
|
| 41 | + private const string TMP_DIR = 'data/tmp'; |
|
| 42 | 42 | private const int MAX_TMP_FILE_AGE = 60 * 60; |
| 43 | 43 | |
| 44 | 44 | // Delete error logs after 90 days. |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | protected const string ROUTE_NAME = FamilyPage::class; |
| 34 | 34 | |
| 35 | 35 | // The husband (or first spouse for same-sex couples) |
| 36 | - private Individual|null $husb = null; |
|
| 36 | + private Individual | null $husb = null; |
|
| 37 | 37 | |
| 38 | 38 | // The wife (or second spouse for same-sex couples) |
| 39 | - private Individual|null $wife = null; |
|
| 39 | + private Individual | null $wife = null; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Create a GedcomRecord object from raw GEDCOM data. |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * empty string for records with pending deletions |
| 48 | 48 | * @param Tree $tree |
| 49 | 49 | */ |
| 50 | - public function __construct(string $xref, string $gedcom, string|null $pending, Tree $tree) |
|
| 50 | + public function __construct(string $xref, string $gedcom, string | null $pending, Tree $tree) |
|
| 51 | 51 | { |
| 52 | 52 | parent::__construct($xref, $gedcom, $pending, $tree); |
| 53 | 53 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @return Individual|null |
| 81 | 81 | */ |
| 82 | - public function husband(int|null $access_level = null): Individual|null |
|
| 82 | + public function husband(int | null $access_level = null): Individual | null |
|
| 83 | 83 | { |
| 84 | 84 | if ($this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS') === '1') { |
| 85 | 85 | $access_level = Auth::PRIV_HIDE; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @return Individual|null |
| 101 | 101 | */ |
| 102 | - public function wife(int|null $access_level = null): Individual|null |
|
| 102 | + public function wife(int | null $access_level = null): Individual | null |
|
| 103 | 103 | { |
| 104 | 104 | if ($this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS') === '1') { |
| 105 | 105 | $access_level = Auth::PRIV_HIDE; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * |
| 141 | 141 | * @return bool |
| 142 | 142 | */ |
| 143 | - public function canShowName(int|null $access_level = null): bool |
|
| 143 | + public function canShowName(int | null $access_level = null): bool |
|
| 144 | 144 | { |
| 145 | 145 | // We can always see the name (Husband-name + Wife-name), however, |
| 146 | 146 | // the name will often be "private + private" |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @return Individual|null |
| 157 | 157 | */ |
| 158 | - public function spouse(Individual $person, int|null $access_level = null): Individual|null |
|
| 158 | + public function spouse(Individual $person, int | null $access_level = null): Individual | null |
|
| 159 | 159 | { |
| 160 | 160 | if ($person === $this->wife) { |
| 161 | 161 | return $this->husband($access_level); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * |
| 172 | 172 | * @return Collection<int,Individual> |
| 173 | 173 | */ |
| 174 | - public function spouses(int|null $access_level = null): Collection |
|
| 174 | + public function spouses(int | null $access_level = null): Collection |
|
| 175 | 175 | { |
| 176 | 176 | $spouses = new Collection([ |
| 177 | 177 | $this->husband($access_level), |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | * |
| 189 | 189 | * @return Collection<int,Individual> |
| 190 | 190 | */ |
| 191 | - public function children(int|null $access_level = null): Collection |
|
| 191 | + public function children(int | null $access_level = null): Collection |
|
| 192 | 192 | { |
| 193 | 193 | $access_level ??= Auth::accessLevel($this->tree); |
| 194 | 194 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | /** |
| 229 | 229 | * get the marriage event |
| 230 | 230 | */ |
| 231 | - public function getMarriage(): Fact|null |
|
| 231 | + public function getMarriage(): Fact | null |
|
| 232 | 232 | { |
| 233 | 233 | return $this->facts(['MARR'])->first(); |
| 234 | 234 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | // Defaults |
| 51 | 51 | public const string DEFAULT_GENERATIONS = '4'; |
| 52 | 52 | public const string DEFAULT_STYLE = self::CHART_STYLE_TREE; |
| 53 | - protected const array DEFAULT_PARAMETERS = [ |
|
| 53 | + protected const array DEFAULT_PARAMETERS = [ |
|
| 54 | 54 | 'generations' => self::DEFAULT_GENERATIONS, |
| 55 | 55 | 'style' => self::DEFAULT_STYLE, |
| 56 | 56 | ]; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | /** |
| 116 | 116 | * Return a menu item for this chart - for use in individual boxes. |
| 117 | 117 | */ |
| 118 | - public function chartBoxMenu(Individual $individual): Menu|null |
|
| 118 | + public function chartBoxMenu(Individual $individual): Menu | null |
|
| 119 | 119 | { |
| 120 | 120 | return $this->chartMenu($individual); |
| 121 | 121 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | // Defaults |
| 51 | 51 | public const string DEFAULT_STYLE = self::CHART_STYLE_TREE; |
| 52 | 52 | public const string DEFAULT_GENERATIONS = '3'; |
| 53 | - protected const array DEFAULT_PARAMETERS = [ |
|
| 53 | + protected const array DEFAULT_PARAMETERS = [ |
|
| 54 | 54 | 'generations' => self::DEFAULT_GENERATIONS, |
| 55 | 55 | 'style' => self::DEFAULT_STYLE, |
| 56 | 56 | ]; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | /** |
| 112 | 112 | * Return a menu item for this chart - for use in individual boxes. |
| 113 | 113 | */ |
| 114 | - public function chartBoxMenu(Individual $individual): Menu|null |
|
| 114 | + public function chartBoxMenu(Individual $individual): Menu | null |
|
| 115 | 115 | { |
| 116 | 116 | return $this->chartMenu($individual); |
| 117 | 117 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | use ModuleBlockTrait; |
| 45 | 45 | |
| 46 | 46 | // Show media linked to events or individuals. |
| 47 | - private const string LINK_ALL = 'all'; |
|
| 47 | + private const string LINK_ALL = 'all'; |
|
| 48 | 48 | private const string LINK_EVENT = 'event'; |
| 49 | 49 | private const string LINK_INDIVIDUAL = 'indi'; |
| 50 | 50 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public const int DEFAULT_STYLE = self::STYLE_THREE_QUARTER_CIRCLE; |
| 85 | 85 | public const int DEFAULT_GENERATIONS = 4; |
| 86 | 86 | public const int DEFAULT_WIDTH = 100; |
| 87 | - protected const array DEFAULT_PARAMETERS = [ |
|
| 87 | + protected const array DEFAULT_PARAMETERS = [ |
|
| 88 | 88 | 'style' => self::DEFAULT_STYLE, |
| 89 | 89 | 'generations' => self::DEFAULT_GENERATIONS, |
| 90 | 90 | 'width' => self::DEFAULT_WIDTH, |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | /** |
| 155 | 155 | * Return a menu item for this chart - for use in individual boxes. |
| 156 | 156 | */ |
| 157 | - public function chartBoxMenu(Individual $individual): Menu|null |
|
| 157 | + public function chartBoxMenu(Individual $individual): Menu | null |
|
| 158 | 158 | { |
| 159 | 159 | return $this->chartMenu($individual); |
| 160 | 160 | } |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | protected const string ROUTE_NAME = IndividualPage::class; |
| 46 | 46 | |
| 47 | 47 | /** Used in some lists to keep track of this individual’s generation in that list */ |
| 48 | - public int|null $generation = null; |
|
| 48 | + public int | null $generation = null; |
|
| 49 | 49 | |
| 50 | - private Date|null $estimated_birth_date = null; |
|
| 50 | + private Date | null $estimated_birth_date = null; |
|
| 51 | 51 | |
| 52 | - private Date|null $estimated_death_date = null; |
|
| 52 | + private Date | null $estimated_death_date = null; |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * A closure which will compare individuals by birth date. |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @return bool |
| 80 | 80 | */ |
| 81 | - public function canShowName(int|null $access_level = null): bool |
|
| 81 | + public function canShowName(int | null $access_level = null): bool |
|
| 82 | 82 | { |
| 83 | 83 | $access_level ??= Auth::accessLevel($this->tree); |
| 84 | 84 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | /** |
| 313 | 313 | * Find the highlighted media object for an individual |
| 314 | 314 | */ |
| 315 | - public function findHighlightedMediaFile(): MediaFile|null |
|
| 315 | + public function findHighlightedMediaFile(): MediaFile | null |
|
| 316 | 316 | { |
| 317 | 317 | $fact = $this->facts(['OBJE']) |
| 318 | 318 | ->first(static function (Fact $fact): bool { |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | * |
| 664 | 664 | * @return Collection<int,Family> |
| 665 | 665 | */ |
| 666 | - public function spouseFamilies(int|null $access_level = null): Collection |
|
| 666 | + public function spouseFamilies(int | null $access_level = null): Collection |
|
| 667 | 667 | { |
| 668 | 668 | $access_level ??= Auth::accessLevel($this->tree); |
| 669 | 669 | |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | * |
| 691 | 691 | * @return Individual|null |
| 692 | 692 | */ |
| 693 | - public function getCurrentSpouse(): Individual|null |
|
| 693 | + public function getCurrentSpouse(): Individual | null |
|
| 694 | 694 | { |
| 695 | 695 | $family = $this->spouseFamilies()->last(); |
| 696 | 696 | |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | * |
| 730 | 730 | * @return Collection<int,Family> |
| 731 | 731 | */ |
| 732 | - public function childFamilies(int|null $access_level = null): Collection |
|
| 732 | + public function childFamilies(int | null $access_level = null): Collection |
|
| 733 | 733 | { |
| 734 | 734 | $access_level ??= Auth::accessLevel($this->tree); |
| 735 | 735 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | protected string $gedcom; |
| 79 | 79 | |
| 80 | 80 | // GEDCOM data (after any pending edits) |
| 81 | - protected string|null $pending; |
|
| 81 | + protected string | null $pending; |
|
| 82 | 82 | |
| 83 | 83 | /** @var array<Fact> Facts extracted from $gedcom/$pending */ |
| 84 | 84 | protected array $facts; |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | protected array $getAllNames = []; |
| 88 | 88 | |
| 89 | 89 | /** @var int|null Cached result */ |
| 90 | - private int|null $getPrimaryName = null; |
|
| 90 | + private int | null $getPrimaryName = null; |
|
| 91 | 91 | |
| 92 | 92 | /** @var int|null Cached result */ |
| 93 | - private int|null $getSecondaryName = null; |
|
| 93 | + private int | null $getSecondaryName = null; |
|
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * Create a GedcomRecord object from raw GEDCOM data. |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * empty string for records with pending deletions |
| 102 | 102 | * @param Tree $tree |
| 103 | 103 | */ |
| 104 | - public function __construct(string $xref, string $gedcom, string|null $pending, Tree $tree) |
|
| 104 | + public function __construct(string $xref, string $gedcom, string | null $pending, Tree $tree) |
|
| 105 | 105 | { |
| 106 | 106 | $this->xref = $xref; |
| 107 | 107 | $this->gedcom = $gedcom; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | * |
| 241 | 241 | * @return bool |
| 242 | 242 | */ |
| 243 | - public function canShow(int|null $access_level = null): bool |
|
| 243 | + public function canShow(int | null $access_level = null): bool |
|
| 244 | 244 | { |
| 245 | 245 | $access_level ??= Auth::accessLevel($this->tree); |
| 246 | 246 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * |
| 263 | 263 | * @return bool |
| 264 | 264 | */ |
| 265 | - public function canShowName(int|null $access_level = null): bool |
|
| 265 | + public function canShowName(int | null $access_level = null): bool |
|
| 266 | 266 | { |
| 267 | 267 | return $this->canShow($access_level); |
| 268 | 268 | } |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | // Remove links to missing and private records |
| 315 | - $pattern = '/\n(\d) ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@/'; |
|
| 315 | + $pattern = '/\n(\d) ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@/'; |
|
| 316 | 316 | preg_match_all($pattern, $gedcom, $matches, PREG_SET_ORDER); |
| 317 | 317 | |
| 318 | 318 | foreach ($matches as $match) { |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | * |
| 433 | 433 | * @return void |
| 434 | 434 | */ |
| 435 | - public function setPrimaryName(int|null $n = null): void |
|
| 435 | + public function setPrimaryName(int | null $n = null): void |
|
| 436 | 436 | { |
| 437 | 437 | $this->getPrimaryName = $n; |
| 438 | 438 | $this->getSecondaryName = null; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | * |
| 484 | 484 | * @return string|null |
| 485 | 485 | */ |
| 486 | - public function alternateName(): string|null |
|
| 486 | + public function alternateName(): string | null |
|
| 487 | 487 | { |
| 488 | 488 | if ($this->canShowName() && $this->getPrimaryName() !== $this->getSecondaryName()) { |
| 489 | 489 | $all_names = $this->getAllNames(); |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | public function facts( |
| 612 | 612 | array $filter = [], |
| 613 | 613 | bool $sort = false, |
| 614 | - int|null $access_level = null, |
|
| 614 | + int | null $access_level = null, |
|
| 615 | 615 | bool $ignore_deleted = false |
| 616 | 616 | ): Collection { |
| 617 | 617 | $access_level ??= Auth::accessLevel($this->tree); |