app/GedcomRecord.php
public static function nameComparator(): Closure
    {
        return static function (GedcomRecord $x, GedcomRecord $y): int {
            if ($x->canShowName()) {
                if ($y->canShowName()) {
                    return I18N::strcasecmp($x->sortName(), $y->sortName());
                }

                return -1; // only $y is private
            }

            if ($y->canShowName()) {
                return 1; // only $x is private
            }

            return 0; // both $x and $y private
        };
    }
public static function nameComparator(): Closure
    {
        return static function (GedcomRecord $x, GedcomRecord $y): int {
            if ($x->canShowName()) {
                if ($y->canShowName()) {
                    return I18N::strcasecmp($x->sortName(), $y->sortName());
                }

                return -1; // only $y is private
            }

            if ($y->canShowName()) {
                return 1; // only $x is private
            }

            return 0; // both $x and $y private
        };
    }
public static function nameComparator ( ) : Closure { return static function ( GedcomRecord $ x , GedcomRecord $ y ) : int { if ( $ x -> canShowName ( ) ) { if ( $ y -> canShowName ( ) ) { return I18N :: strcasecmp ( $ x -> sortName ( ) , $ y -> sortName ( ) ) ; } return - 1 ; // only $y is private } if ( $ y -> canShowName ( ) ) { return 1 ; // only $x is private } return 0 ; // both $x and $y private } ; }
A closure which will compare records by name.

@return Closure
A closure which will compare records by name .