Skip to content

Commit

Permalink
Resolves #3886: Prevent fatal error for duplicate individuals not con…
Browse files Browse the repository at this point in the history
…nected to a family anymore
  • Loading branch information
magicsunday committed May 13, 2021
1 parent 4da9684 commit 08df80a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Services/RelationshipService.php
Expand Up @@ -70,9 +70,9 @@ class RelationshipService
* @param Individual $individual1
* @param Individual $individual2
*
* @return string
* @return null|string
*/
public function getCloseRelationshipName(Individual $individual1, Individual $individual2): string
public function getCloseRelationshipName(Individual $individual1, Individual $individual2): ?string
{
$language = app(ModuleService::class)
->findByInterface(ModuleLanguageInterface::class, true)
Expand Down Expand Up @@ -195,9 +195,9 @@ private function getCloseRelationship(Individual $individual1, Individual $indiv
* @param array<Individual|Family> $nodes
* @param ModuleLanguageInterface $language
*
* @return string
* @return null|string
*/
public function nameFromPath(array $nodes, ModuleLanguageInterface $language): string
public function nameFromPath(array $nodes, ModuleLanguageInterface $language): ?string
{
// The relationship matching algorithm could be used for this, but it is more efficient to check it here.
if (count($nodes) === 1) {
Expand Down Expand Up @@ -317,11 +317,11 @@ protected function matchRelationships(array $nodes, array $pattern, array $relat

/**
*
* @return string
* @return null|string
*
* @deprecated This code was originally Functions::getRelationshipNameFromPath
*/
public function legacyNameAlgorithm(string $path, Individual $person1 = null, Individual $person2 = null): string
public function legacyNameAlgorithm(string $path, Individual $person1 = null, Individual $person2 = null): ?string
{
// The path does not include the starting person. In some languages, the
// translation for a man’s (relative) is different from a woman’s (relative),
Expand Down

0 comments on commit 08df80a

Please sign in to comment.