1<?php 2/** 3 * webtrees: online genealogy 4 * Copyright (C) 2018 webtrees development team 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 */ 16namespace Fisharebest\Webtrees\SurnameTradition; 17 18/** 19 * Various cultures have different traditions for the use of surnames within families. 20 * By providing defaults for new individuals, we can speed up data entry and reduce errors. 21 */ 22interface SurnameTraditionInterface 23{ 24 /** 25 * Does this surname tradition change surname at marriage? 26 * 27 * @return bool 28 */ 29 public function hasMarriedNames(); 30 31 /** 32 * Does this surname tradition use surnames? 33 * 34 * @return bool 35 */ 36 public function hasSurnames(); 37 38 /** 39 * What names are given to a new child 40 * 41 * @param string $father_name A GEDCOM NAME 42 * @param string $mother_name A GEDCOM NAME 43 * @param string $child_sex M, F or U 44 * 45 * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.) 46 */ 47 public function newChildNames(string $father_name, string $mother_name, string $child_sex): array; 48 49 /** 50 * What names are given to a new parent 51 * 52 * @param string $child_name A GEDCOM NAME 53 * @param string $parent_sex M, F or U 54 * 55 * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.) 56 */ 57 public function newParentNames(string $child_name, string $parent_sex): array; 58 59 /** 60 * What names are given to a new spouse 61 * 62 * @param string $spouse_name A GEDCOM NAME 63 * @param string $spouse_sex M, F or U 64 * 65 * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.) 66 */ 67 public function newSpouseNames(string $spouse_name, string $spouse_sex): array; 68} 69