app/Services/ClipboardService.php
public function pastableFacts(GedcomRecord $record, Collection $exclude_types): Collection
    {
        // The facts are stored in the session.
        return (new Collection(Session::get('clipboard', [])[$record::RECORD_TYPE] ?? []))
            // Put the most recently copied fact at the top of the list.
            ->reverse()
            // Create facts for the record.
            ->map(static function (array $clipping) use ($record): Fact {
                return new Fact($clipping['factrec'], $record, md5($clipping['factrec']));
            })->filter(static function (Fact $fact) use ($exclude_types): bool {
                return $exclude_types->isEmpty() || !$exclude_types->contains($fact->getTag());
            });
    }
public function pastableFacts(GedcomRecord $record, Collection $exclude_types): Collection
    {
        // The facts are stored in the session.
        return (new Collection(Session::get('clipboard', [])[$record::RECORD_TYPE] ?? []))
            // Put the most recently copied fact at the top of the list.
            ->reverse()
            // Create facts for the record.
            ->map(static function (array $clipping) use ($record): Fact {
                return new Fact($clipping['factrec'], $record, md5($clipping['factrec']));
            })->filter(static function (Fact $fact) use ($exclude_types): bool {
                return $exclude_types->isEmpty() || !$exclude_types->contains($fact->getTag());
            });
    }
public function pastableFacts ( GedcomRecord $ record , Collection $ exclude_types ) : Collection { // The facts are stored in the session. return ( new Collection ( Session :: get ( 'clipboard' , [ ] ) [ $ record :: RECORD_TYPE ] ?? [ ] ) ) // Put the most recently copied fact at the top of the list. -> reverse ( ) // Create facts for the record. -> map ( static function ( array $ clipping ) use ( $ record ) : Fact { return new Fact ( $ clipping [ 'factrec' ] , $ record , md5 ( $ clipping [ 'factrec' ] ) ) ; } ) -> filter ( static function ( Fact $ fact ) use ( $ exclude_types ) : bool { return $ exclude_types -> isEmpty ( ) || ! $ exclude_types -> contains ( $ fact -> getTag ( ) ) ; } ) ; }
Create a list of facts that can be pasted into a given record

@param GedcomRecord $record
@param Collection   $exclude_types

@return Collection
@return Fact[]
Create a list of facts that can be pasted into a given record