| Conditions | 107 |
| Paths | > 20000 |
| Total Lines | 428 |
| Code Lines | 312 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 515 | public function searchIndividualsAdvanced(array $trees, array $fields, array $modifiers): Collection |
||
| 516 | { |
||
| 517 | $fields = array_filter($fields, static fn (string $x): bool => $x !== ''); |
||
| 518 | |||
| 519 | $query = DB::table('individuals') |
||
| 520 | ->select(['individuals.*']) |
||
| 521 | ->distinct(); |
||
| 522 | |||
| 523 | $this->whereTrees($query, 'i_file', $trees); |
||
| 524 | |||
| 525 | // Join the following tables |
||
| 526 | $father_name = false; |
||
| 527 | $mother_name = false; |
||
| 528 | $spouse_family = false; |
||
| 529 | $indi_name = false; |
||
| 530 | $indi_dates = []; |
||
| 531 | $fam_dates = []; |
||
| 532 | $indi_plac = false; |
||
| 533 | $fam_plac = false; |
||
| 534 | |||
| 535 | foreach ($fields as $field_name => $field_value) { |
||
| 536 | if (str_starts_with($field_name, 'FATHER:NAME')) { |
||
| 537 | $father_name = true; |
||
| 538 | } elseif (str_starts_with($field_name, 'MOTHER:NAME')) { |
||
| 539 | $mother_name = true; |
||
| 540 | } elseif (str_starts_with($field_name, 'INDI:NAME:GIVN')) { |
||
| 541 | $indi_name = true; |
||
| 542 | } elseif (str_starts_with($field_name, 'INDI:NAME:SURN')) { |
||
| 543 | $indi_name = true; |
||
| 544 | } elseif (str_starts_with($field_name, 'FAM:')) { |
||
| 545 | $spouse_family = true; |
||
| 546 | if (str_ends_with($field_name, ':DATE')) { |
||
| 547 | $fam_dates[] = explode(':', $field_name)[1]; |
||
| 548 | } elseif (str_ends_with($field_name, ':PLAC')) { |
||
| 549 | $fam_plac = true; |
||
| 550 | } |
||
| 551 | } elseif (str_starts_with($field_name, 'INDI:')) { |
||
| 552 | if (str_ends_with($field_name, ':DATE')) { |
||
| 553 | $indi_dates[] = explode(':', $field_name)[1]; |
||
| 554 | } elseif (str_ends_with($field_name, ':PLAC')) { |
||
| 555 | $indi_plac = true; |
||
| 556 | } |
||
| 557 | } |
||
| 558 | } |
||
| 559 | |||
| 560 | if ($father_name || $mother_name) { |
||
| 561 | $query->join('link AS l1', static function (JoinClause $join): void { |
||
| 562 | $join |
||
| 563 | ->on('l1.l_file', '=', 'individuals.i_file') |
||
| 564 | ->on('l1.l_from', '=', 'individuals.i_id') |
||
| 565 | ->where('l1.l_type', '=', 'FAMC'); |
||
| 566 | }); |
||
| 567 | |||
| 568 | if ($father_name) { |
||
| 569 | $query->join('link AS l2', static function (JoinClause $join): void { |
||
| 570 | $join |
||
| 571 | ->on('l2.l_file', '=', 'l1.l_file') |
||
| 572 | ->on('l2.l_from', '=', 'l1.l_to') |
||
| 573 | ->where('l2.l_type', '=', 'HUSB'); |
||
| 574 | }); |
||
| 575 | $query->join('name AS father_name', static function (JoinClause $join): void { |
||
| 576 | $join |
||
| 577 | ->on('father_name.n_file', '=', 'l2.l_file') |
||
| 578 | ->on('father_name.n_id', '=', 'l2.l_to'); |
||
| 579 | }); |
||
| 580 | } |
||
| 581 | |||
| 582 | if ($mother_name) { |
||
| 583 | $query->join('link AS l3', static function (JoinClause $join): void { |
||
| 584 | $join |
||
| 585 | ->on('l3.l_file', '=', 'l1.l_file') |
||
| 586 | ->on('l3.l_from', '=', 'l1.l_to') |
||
| 587 | ->where('l3.l_type', '=', 'WIFE'); |
||
| 588 | }); |
||
| 589 | $query->join('name AS mother_name', static function (JoinClause $join): void { |
||
| 590 | $join |
||
| 591 | ->on('mother_name.n_file', '=', 'l3.l_file') |
||
| 592 | ->on('mother_name.n_id', '=', 'l3.l_to'); |
||
| 593 | }); |
||
| 594 | } |
||
| 595 | } |
||
| 596 | |||
| 597 | if ($spouse_family) { |
||
| 598 | $query->join('link AS l4', static function (JoinClause $join): void { |
||
| 599 | $join |
||
| 600 | ->on('l4.l_file', '=', 'individuals.i_file') |
||
| 601 | ->on('l4.l_from', '=', 'individuals.i_id') |
||
| 602 | ->where('l4.l_type', '=', 'FAMS'); |
||
| 603 | }); |
||
| 604 | $query->join('families AS spouse_families', static function (JoinClause $join): void { |
||
| 605 | $join |
||
| 606 | ->on('spouse_families.f_file', '=', 'l4.l_file') |
||
| 607 | ->on('spouse_families.f_id', '=', 'l4.l_to'); |
||
| 608 | }); |
||
| 609 | } |
||
| 610 | |||
| 611 | if ($indi_name) { |
||
| 612 | $query->join('name AS individual_name', static function (JoinClause $join): void { |
||
| 613 | $join |
||
| 614 | ->on('individual_name.n_file', '=', 'individuals.i_file') |
||
| 615 | ->on('individual_name.n_id', '=', 'individuals.i_id'); |
||
| 616 | }); |
||
| 617 | } |
||
| 618 | |||
| 619 | foreach (array_unique($indi_dates) as $indi_date) { |
||
| 620 | $query->join('dates AS date_' . $indi_date, static function (JoinClause $join) use ($indi_date): void { |
||
| 621 | $join |
||
| 622 | ->on('date_' . $indi_date . '.d_file', '=', 'individuals.i_file') |
||
| 623 | ->on('date_' . $indi_date . '.d_gid', '=', 'individuals.i_id'); |
||
| 624 | }); |
||
| 625 | } |
||
| 626 | |||
| 627 | foreach (array_unique($fam_dates) as $fam_date) { |
||
| 628 | $query->join('dates AS date_' . $fam_date, static function (JoinClause $join) use ($fam_date): void { |
||
| 629 | $join |
||
| 630 | ->on('date_' . $fam_date . '.d_file', '=', 'spouse_families.f_file') |
||
| 631 | ->on('date_' . $fam_date . '.d_gid', '=', 'spouse_families.f_id'); |
||
| 632 | }); |
||
| 633 | } |
||
| 634 | |||
| 635 | if ($indi_plac) { |
||
| 636 | $query->join('placelinks AS individual_placelinks', static function (JoinClause $join): void { |
||
| 637 | $join |
||
| 638 | ->on('individual_placelinks.pl_file', '=', 'individuals.i_file') |
||
| 639 | ->on('individual_placelinks.pl_gid', '=', 'individuals.i_id'); |
||
| 640 | }); |
||
| 641 | $query->join('places AS individual_places', static function (JoinClause $join): void { |
||
| 642 | $join |
||
| 643 | ->on('individual_places.p_file', '=', 'individual_placelinks.pl_file') |
||
| 644 | ->on('individual_places.p_id', '=', 'individual_placelinks.pl_p_id'); |
||
| 645 | }); |
||
| 646 | } |
||
| 647 | |||
| 648 | if ($fam_plac) { |
||
| 649 | $query->join('placelinks AS familyl_placelinks', static function (JoinClause $join): void { |
||
| 650 | $join |
||
| 651 | ->on('familyl_placelinks.pl_file', '=', 'individuals.i_file') |
||
| 652 | ->on('familyl_placelinks.pl_gid', '=', 'individuals.i_id'); |
||
| 653 | }); |
||
| 654 | $query->join('places AS family_places', static function (JoinClause $join): void { |
||
| 655 | $join |
||
| 656 | ->on('family_places.p_file', '=', 'familyl_placelinks.pl_file') |
||
| 657 | ->on('family_places.p_id', '=', 'familyl_placelinks.pl_p_id'); |
||
| 658 | }); |
||
| 659 | } |
||
| 660 | |||
| 661 | foreach ($fields as $field_name => $field_value) { |
||
| 662 | $parts = explode(':', $field_name . ':::'); |
||
| 663 | if (str_starts_with($field_name, 'INDI:NAME:')) { |
||
| 664 | switch ($field_name) { |
||
| 665 | case 'INDI:NAME:GIVN': |
||
| 666 | switch ($modifiers[$field_name]) { |
||
| 667 | case 'EXACT': |
||
| 668 | $query->where('individual_name.n_givn', '=', $field_value); |
||
| 669 | break; |
||
| 670 | case 'BEGINS': |
||
| 671 | $query->where('individual_name.n_givn', $this->iLike(), $field_value . '%'); |
||
| 672 | break; |
||
| 673 | case 'CONTAINS': |
||
| 674 | $query->where('individual_name.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 675 | break; |
||
| 676 | case 'SDX_STD': |
||
| 677 | $sdx = Soundex::russell($field_value); |
||
| 678 | if ($sdx !== '') { |
||
| 679 | $this->wherePhonetic($query, 'individual_name.n_soundex_givn_std', $sdx); |
||
| 680 | } else { |
||
| 681 | // No phonetic content? Use a substring match |
||
| 682 | $query->where('individual_name.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 683 | } |
||
| 684 | break; |
||
| 685 | case 'SDX': // SDX uses DM by default. |
||
| 686 | case 'SDX_DM': |
||
| 687 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 688 | if ($sdx !== '') { |
||
| 689 | $this->wherePhonetic($query, 'individual_name.n_soundex_givn_dm', $sdx); |
||
| 690 | } else { |
||
| 691 | // No phonetic content? Use a substring match |
||
| 692 | $query->where('individual_name.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 693 | } |
||
| 694 | break; |
||
| 695 | } |
||
| 696 | unset($fields[$field_name]); |
||
| 697 | break; |
||
| 698 | case 'INDI:NAME:SURN': |
||
| 699 | switch ($modifiers[$field_name]) { |
||
| 700 | case 'EXACT': |
||
| 701 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 702 | $query |
||
| 703 | ->where('individual_name.n_surn', '=', $field_value) |
||
| 704 | ->orWhere('individual_name.n_surname', '=', $field_value); |
||
| 705 | }); |
||
| 706 | break; |
||
| 707 | case 'BEGINS': |
||
| 708 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 709 | $query |
||
| 710 | ->where('individual_name.n_surn', $this->iLike(), $field_value . '%') |
||
| 711 | ->orWhere('individual_name.n_surname', $this->iLike(), $field_value . '%'); |
||
| 712 | }); |
||
| 713 | break; |
||
| 714 | case 'CONTAINS': |
||
| 715 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 716 | $query |
||
| 717 | ->where('individual_name.n_surn', $this->iLike(), '%' . $field_value . '%') |
||
| 718 | ->orWhere('individual_name.n_surname', $this->iLike(), '%' . $field_value . '%'); |
||
| 719 | }); |
||
| 720 | break; |
||
| 721 | case 'SDX_STD': |
||
| 722 | $sdx = Soundex::russell($field_value); |
||
| 723 | if ($sdx !== '') { |
||
| 724 | $this->wherePhonetic($query, 'individual_name.n_soundex_surn_std', $sdx); |
||
| 725 | } else { |
||
| 726 | // No phonetic content? Use a substring match |
||
| 727 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 728 | $query |
||
| 729 | ->where('individual_name.n_surn', $this->iLike(), '%' . $field_value . '%') |
||
| 730 | ->orWhere('individual_name.n_surname', $this->iLike(), '%' . $field_value . '%'); |
||
| 731 | }); |
||
| 732 | } |
||
| 733 | break; |
||
| 734 | case 'SDX': // SDX uses DM by default. |
||
| 735 | case 'SDX_DM': |
||
| 736 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 737 | if ($sdx !== '') { |
||
| 738 | $this->wherePhonetic($query, 'individual_name.n_soundex_surn_dm', $sdx); |
||
| 739 | } else { |
||
| 740 | // No phonetic content? Use a substring match |
||
| 741 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 742 | $query |
||
| 743 | ->where('individual_name.n_surn', $this->iLike(), '%' . $field_value . '%') |
||
| 744 | ->orWhere('individual_name.n_surname', $this->iLike(), '%' . $field_value . '%'); |
||
| 745 | }); |
||
| 746 | } |
||
| 747 | break; |
||
| 748 | } |
||
| 749 | unset($fields[$field_name]); |
||
| 750 | break; |
||
| 751 | case 'INDI:NAME:NICK': |
||
| 752 | case 'INDI:NAME:_MARNM': |
||
| 753 | case 'INDI:NAME:_HEB': |
||
| 754 | case 'INDI:NAME:_AKA': |
||
| 755 | $like = "%\n1 NAME%\n2 " . $parts[2] . ' %' . preg_quote($field_value, '/') . '%'; |
||
| 756 | $query->where('individuals.i_gedcom', $this->iLike(), $like); |
||
| 757 | break; |
||
| 758 | } |
||
| 759 | } elseif (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':DATE')) { |
||
| 760 | $date = new Date($field_value); |
||
| 761 | if ($date->isOK()) { |
||
| 762 | $delta = 365 * (int) ($modifiers[$field_name] ?? 0); |
||
| 763 | $query |
||
| 764 | ->where('date_' . $parts[1] . '.d_fact', '=', $parts[1]) |
||
| 765 | ->where('date_' . $parts[1] . '.d_julianday1', '>=', $date->minimumJulianDay() - $delta) |
||
| 766 | ->where('date_' . $parts[1] . '.d_julianday2', '<=', $date->maximumJulianDay() + $delta); |
||
| 767 | } |
||
| 768 | unset($fields[$field_name]); |
||
| 769 | } elseif (str_starts_with($field_name, 'FAM:') && str_ends_with($field_name, ':DATE')) { |
||
| 770 | $date = new Date($field_value); |
||
| 771 | if ($date->isOK()) { |
||
| 772 | $delta = 365 * (int) ($modifiers[$field_name] ?? 0); |
||
| 773 | $query |
||
| 774 | ->where('date_' . $parts[1] . '.d_fact', '=', $parts[1]) |
||
| 775 | ->where('date_' . $parts[1] . '.d_julianday1', '>=', $date->minimumJulianDay() - $delta) |
||
| 776 | ->where('date_' . $parts[1] . '.d_julianday2', '<=', $date->maximumJulianDay() + $delta); |
||
| 777 | } |
||
| 778 | unset($fields[$field_name]); |
||
| 779 | } elseif (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':PLAC')) { |
||
| 780 | // SQL can only link a place to a person/family, not to an event. |
||
| 781 | $query->where('individual_places.p_place', $this->iLike(), '%' . $field_value . '%'); |
||
| 782 | } elseif (str_starts_with($field_name, 'FAM:') && str_ends_with($field_name, ':PLAC')) { |
||
| 783 | // SQL can only link a place to a person/family, not to an event. |
||
| 784 | $query->where('family_places.p_place', $this->iLike(), '%' . $field_value . '%'); |
||
| 785 | } elseif (str_starts_with($field_name, 'MOTHER:NAME:') || str_starts_with($field_name, 'FATHER:NAME:')) { |
||
| 786 | $table = str_starts_with($field_name, 'FATHER:NAME:') ? 'father_name' : 'mother_name'; |
||
| 787 | switch ($parts[2]) { |
||
| 788 | case 'GIVN': |
||
| 789 | switch ($modifiers[$field_name]) { |
||
| 790 | case 'EXACT': |
||
| 791 | $query->where($table . '.n_givn', '=', $field_value); |
||
| 792 | break; |
||
| 793 | case 'BEGINS': |
||
| 794 | $query->where($table . '.n_givn', $this->iLike(), $field_value . '%'); |
||
| 795 | break; |
||
| 796 | case 'CONTAINS': |
||
| 797 | $query->where($table . '.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 798 | break; |
||
| 799 | case 'SDX_STD': |
||
| 800 | $sdx = Soundex::russell($field_value); |
||
| 801 | if ($sdx !== '') { |
||
| 802 | $this->wherePhonetic($query, $table . '.n_soundex_givn_std', $sdx); |
||
| 803 | } else { |
||
| 804 | // No phonetic content? Use a substring match |
||
| 805 | $query->where($table . '.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 806 | } |
||
| 807 | break; |
||
| 808 | case 'SDX': // SDX uses DM by default. |
||
| 809 | case 'SDX_DM': |
||
| 810 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 811 | if ($sdx !== '') { |
||
| 812 | $this->wherePhonetic($query, $table . '.n_soundex_givn_dm', $sdx); |
||
| 813 | } else { |
||
| 814 | // No phonetic content? Use a substring match |
||
| 815 | $query->where($table . '.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 816 | } |
||
| 817 | break; |
||
| 818 | } |
||
| 819 | break; |
||
| 820 | case 'SURN': |
||
| 821 | switch ($modifiers[$field_name]) { |
||
| 822 | case 'EXACT': |
||
| 823 | $query->where($table . '.n_surn', '=', $field_value); |
||
| 824 | break; |
||
| 825 | case 'BEGINS': |
||
| 826 | $query->where($table . '.n_surn', $this->iLike(), $field_value . '%'); |
||
| 827 | break; |
||
| 828 | case 'CONTAINS': |
||
| 829 | $query->where($table . '.n_surn', $this->iLike(), '%' . $field_value . '%'); |
||
| 830 | break; |
||
| 831 | case 'SDX_STD': |
||
| 832 | $sdx = Soundex::russell($field_value); |
||
| 833 | if ($sdx !== '') { |
||
| 834 | $this->wherePhonetic($query, $table . '.n_soundex_surn_std', $sdx); |
||
| 835 | } else { |
||
| 836 | // No phonetic content? Use a substring match |
||
| 837 | $query->where($table . '.n_surn', $this->iLike(), '%' . $field_value . '%'); |
||
| 838 | } |
||
| 839 | break; |
||
| 840 | case 'SDX': // SDX uses DM by default. |
||
| 841 | case 'SDX_DM': |
||
| 842 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 843 | if ($sdx !== '') { |
||
| 844 | $this->wherePhonetic($query, $table . '.n_soundex_surn_dm', $sdx); |
||
| 845 | } else { |
||
| 846 | // No phonetic content? Use a substring match |
||
| 847 | $query->where($table . '.n_surn', $this->iLike(), '%' . $field_value . '%'); |
||
| 848 | } |
||
| 849 | break; |
||
| 850 | } |
||
| 851 | break; |
||
| 852 | } |
||
| 853 | unset($fields[$field_name]); |
||
| 854 | } elseif (str_starts_with($field_name, 'FAM:')) { |
||
| 855 | // e.g. searches for occupation, religion, note, etc. |
||
| 856 | // Initial matching only. Need PHP to apply filter. |
||
| 857 | $query->where('spouse_families.f_gedcom', $this->iLike(), "%\n1 " . $parts[1] . ' %' . $field_value . '%'); |
||
| 858 | } elseif (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':TYPE')) { |
||
| 859 | // Initial matching only. Need PHP to apply filter. |
||
| 860 | $query->where('individuals.i_gedcom', $this->iLike(), "%\n1 " . $parts[1] . "%\n2 TYPE %" . $field_value . '%'); |
||
| 861 | } elseif (str_starts_with($field_name, 'INDI:')) { |
||
| 862 | // e.g. searches for occupation, religion, note, etc. |
||
| 863 | // Initial matching only. Need PHP to apply filter. |
||
| 864 | $query->where('individuals.i_gedcom', $this->iLike(), "%\n1 " . $parts[1] . '%' . $parts[2] . '%' . $field_value . '%'); |
||
| 865 | } |
||
| 866 | } |
||
| 867 | |||
| 868 | return $query |
||
| 869 | ->get() |
||
| 870 | ->each($this->rowLimiter()) |
||
| 871 | ->map($this->individualRowMapper()) |
||
| 872 | ->filter(GedcomRecord::accessFilter()) |
||
| 873 | ->filter(static function (Individual $individual) use ($fields): bool { |
||
| 874 | // Check for searches which were only partially matched by SQL |
||
| 875 | foreach ($fields as $field_name => $field_value) { |
||
| 876 | $parts = explode(':', $field_name . '::::'); |
||
| 877 | |||
| 878 | if (str_starts_with($field_name, 'INDI:NAME:') && $field_name !== 'INDI:NAME:GIVN' && $field_name !== 'INDI:NAME:SURN') { |
||
| 879 | $regex = '/\n1 NAME.*(?:\n2.*)*\n2 ' . $parts[2] . ' .*' . preg_quote($field_value, '/') . '/i'; |
||
| 880 | |||
| 881 | if (preg_match($regex, $individual->gedcom()) === 1) { |
||
| 882 | continue; |
||
| 883 | } |
||
| 884 | |||
| 885 | return false; |
||
| 886 | } |
||
| 887 | |||
| 888 | $regex = '/' . preg_quote($field_value, '/') . '/i'; |
||
| 889 | |||
| 890 | if (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':PLAC')) { |
||
| 891 | foreach ($individual->facts([$parts[1]]) as $fact) { |
||
| 892 | if (preg_match($regex, $fact->place()->gedcomName()) === 1) { |
||
| 893 | continue 2; |
||
| 894 | } |
||
| 895 | } |
||
| 896 | return false; |
||
| 897 | } |
||
| 898 | |||
| 899 | if (str_starts_with($field_name, 'FAM:') && str_ends_with($field_name, ':PLAC')) { |
||
| 900 | foreach ($individual->spouseFamilies() as $family) { |
||
| 901 | foreach ($family->facts([$parts[1]]) as $fact) { |
||
| 902 | if (preg_match($regex, $fact->place()->gedcomName()) === 1) { |
||
| 903 | continue 3; |
||
| 904 | } |
||
| 905 | } |
||
| 906 | } |
||
| 907 | return false; |
||
| 908 | } |
||
| 909 | |||
| 910 | if ($field_name === 'INDI:FACT:TYPE' || $field_name === 'INDI:EVEN:TYPE' || $field_name === 'INDI:CHAN:_WT_USER') { |
||
| 911 | foreach ($individual->facts([$parts[1]]) as $fact) { |
||
| 912 | if (preg_match($regex, $fact->attribute($parts[2])) === 1) { |
||
| 913 | continue 2; |
||
| 914 | } |
||
| 915 | } |
||
| 916 | |||
| 917 | return false; |
||
| 918 | } |
||
| 919 | |||
| 920 | if (str_starts_with($field_name, 'INDI:')) { |
||
| 921 | foreach ($individual->facts([$parts[1]]) as $fact) { |
||
| 922 | if (preg_match($regex, $fact->value()) === 1) { |
||
| 923 | continue 2; |
||
| 924 | } |
||
| 925 | } |
||
| 926 | |||
| 927 | return false; |
||
| 928 | } |
||
| 929 | |||
| 930 | if (str_starts_with($field_name, 'FAM:')) { |
||
| 931 | foreach ($individual->spouseFamilies() as $family) { |
||
| 932 | foreach ($family->facts([$parts[1]]) as $fact) { |
||
| 933 | if (preg_match($regex, $fact->value()) === 1) { |
||
| 934 | continue 3; |
||
| 935 | } |
||
| 936 | } |
||
| 937 | } |
||
| 938 | return false; |
||
| 939 | } |
||
| 940 | } |
||
| 941 | |||
| 942 | return true; |
||
| 943 | }); |
||
| 1334 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.