app/GedcomRecord.php
private function parseFacts(): void
    {
        // Split the record into facts
        if ($this->gedcom) {
            $gedcom_facts = preg_split('/\n(?=1)/s', $this->gedcom);
            array_shift($gedcom_facts);
        } else {
            $gedcom_facts = [];
        }
        if ($this->pending) {
            $pending_facts = preg_split('/\n(?=1)/s', $this->pending);
            array_shift($pending_facts);
        } else {
            $pending_facts = [];
        }

        $this->facts = [];

        foreach ($gedcom_facts as $gedcom_fact) {
            $fact = new Fact($gedcom_fact, $this, md5($gedcom_fact));
            if ($this->pending !== null && !in_array($gedcom_fact, $pending_facts, true)) {
                $fact->setPendingDeletion();
            }
            $this->facts[] = $fact;
        }
        foreach ($pending_facts as $pending_fact) {
            if (!in_array($pending_fact, $gedcom_facts, true)) {
                $fact = new Fact($pending_fact, $this, md5($pending_fact));
                $fact->setPendingAddition();
                $this->facts[] = $fact;
            }
        }
    }
private function parseFacts(): void
    {
        // Split the record into facts
        if ($this->gedcom) {
            $gedcom_facts = preg_split('/\n(?=1)/s', $this->gedcom);
            array_shift($gedcom_facts);
        } else {
            $gedcom_facts = [];
        }
        if ($this->pending) {
            $pending_facts = preg_split('/\n(?=1)/s', $this->pending);
            array_shift($pending_facts);
        } else {
            $pending_facts = [];
        }

        $this->facts = [];

        foreach ($gedcom_facts as $gedcom_fact) {
            $fact = new Fact($gedcom_fact, $this, md5($gedcom_fact));
            if ($this->pending !== null && !in_array($gedcom_fact, $pending_facts, true)) {
                $fact->setPendingDeletion();
            }
            $this->facts[] = $fact;
        }
        foreach ($pending_facts as $pending_fact) {
            if (!in_array($pending_fact, $gedcom_facts, true)) {
                $fact = new Fact($pending_fact, $this, md5($pending_fact));
                $fact->setPendingAddition();
                $this->facts[] = $fact;
            }
        }
    }
private function parseFacts ( ) : void { // Split the record into facts if ( $ this -> gedcom ) { $ gedcom_facts = preg_split ( '/\n(?=1)/s' , $ this -> gedcom ) ; array_shift ( $ gedcom_facts ) ; } else { $ gedcom_facts = [ ] ; } if ( $ this -> pending ) { $ pending_facts = preg_split ( '/\n(?=1)/s' , $ this -> pending ) ; array_shift ( $ pending_facts ) ; } else { $ pending_facts = [ ] ; } $ this -> facts = [ ] ; foreach ( $ gedcom_facts as $ gedcom_fact ) { $ fact = new Fact ( $ gedcom_fact , $ this , md5 ( $ gedcom_fact ) ) ; if ( $ this -> pending !== null && ! in_array ( $ gedcom_fact , $ pending_facts , true ) ) { $ fact -> setPendingDeletion ( ) ; } $ this -> facts [ ] = $ fact ; } foreach ( $ pending_facts as $ pending_fact ) { if ( ! in_array ( $ pending_fact , $ gedcom_facts , true ) ) { $ fact = new Fact ( $ pending_fact , $ this , md5 ( $ pending_fact ) ) ; $ fact -> setPendingAddition ( ) ; $ this -> facts [ ] = $ fact ; } } }
Split the record into facts

@return void
Split the record into facts