app/Http/Controllers/BranchesController.php
public function getPatriarchsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std): string
    {
        $html = '';
        foreach ($individuals as $individual) {
            foreach ($individual->childFamilies() as $family) {
                foreach ($family->spouses() as $parent) {
                    if (in_array($parent, $individuals, true)) {
                        continue 3;
                    }
                }
            }
            $html .= $this->getDescendantsHtml($tree, $individuals, $ancestors, $surname, $soundex_dm, $soundex_std, $individual, null);
        }

        return $html;
    }
public function getPatriarchsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std): string
    {
        $html = '';
        foreach ($individuals as $individual) {
            foreach ($individual->childFamilies() as $family) {
                foreach ($family->spouses() as $parent) {
                    if (in_array($parent, $individuals, true)) {
                        continue 3;
                    }
                }
            }
            $html .= $this->getDescendantsHtml($tree, $individuals, $ancestors, $surname, $soundex_dm, $soundex_std, $individual, null);
        }

        return $html;
    }
public function getPatriarchsHtml ( Tree $ tree , array $ individuals , array $ ancestors , string $ surname , bool $ soundex_dm , bool $ soundex_std ) : string { $ html = '' ; foreach ( $ individuals as $ individual ) { foreach ( $ individual -> childFamilies ( ) as $ family ) { foreach ( $ family -> spouses ( ) as $ parent ) { if ( in_array ( $ parent , $ individuals , true ) ) { continue 3 ; } } } $ html .= $ this -> getDescendantsHtml ( $ tree , $ individuals , $ ancestors , $ surname , $ soundex_dm , $ soundex_std , $ individual , null ) ; } return $ html ; }
For each individual with no ancestors, list their descendants.

@param Tree         $tree
@param Individual[] $individuals
@param Individual[] $ancestors
@param string       $surname
@param bool         $soundex_dm
@param bool         $soundex_std

@return string
For each individual with no ancestors list their descendants .