| 1 | <?php |
||
| 8 | class SalutationMapper extends AbstractMapper |
||
| 9 | { |
||
| 10 | protected $salutations = []; |
||
| 11 | |||
| 12 | public function __construct(array $salutations) |
||
| 16 | |||
| 17 | /** |
||
| 18 | * map salutations in the parts array |
||
| 19 | * |
||
| 20 | * @param array $parts the name parts |
||
| 21 | * @return array the mapped parts |
||
| 22 | */ |
||
| 23 | public function map(array $parts): array |
||
| 37 | |||
| 38 | /** |
||
| 39 | * check if the given word is a viable salutation |
||
| 40 | * |
||
| 41 | * @param string $word the word to check |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | protected function isSalutation($word): bool |
||
| 48 | } |
||
| 49 |