app/Census/AbstractCensusColumn.php
public function spouseFamily(Individual $individual): ?Family
    {
        // Exclude families that were created after this census date
        $families = [];
        foreach ($individual->spouseFamilies() as $family) {
            if (Date::compare($family->getMarriageDate(), $this->date()) <= 0) {
                $families[] = $family;
            }
        }

        if (empty($families)) {
            return null;
        }

        usort($families, static function (Family $x, Family $y): int {
            return Date::compare($x->getMarriageDate(), $y->getMarriageDate());
        });

        return end($families);
    }
public function spouseFamily(Individual $individual): ?Family
    {
        // Exclude families that were created after this census date
        $families = [];
        foreach ($individual->spouseFamilies() as $family) {
            if (Date::compare($family->getMarriageDate(), $this->date()) <= 0) {
                $families[] = $family;
            }
        }

        if (empty($families)) {
            return null;
        }

        usort($families, static function (Family $x, Family $y): int {
            return Date::compare($x->getMarriageDate(), $y->getMarriageDate());
        });

        return end($families);
    }
public function spouseFamily ( Individual $ individual ) : ? Family { // Exclude families that were created after this census date $ families = [ ] ; foreach ( $ individual -> spouseFamilies ( ) as $ family ) { if ( Date :: compare ( $ family -> getMarriageDate ( ) , $ this -> date ( ) ) <= 0 ) { $ families [ ] = $ family ; } } if ( empty ( $ families ) ) { return null ; } usort ( $ families , static function ( Family $ x , Family $ y ) : int { return Date :: compare ( $ x -> getMarriageDate ( ) , $ y -> getMarriageDate ( ) ) ; } ) ; return end ( $ families ) ; }
Find the current spouse family of an individual

@param Individual $individual

@return Family|null
Find the current spouse family of an individual