Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
NameValues
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 getSalutations
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getSuffixes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLastnamePrefixes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getNicknameDelimiters
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <nick@popphp.org>
8 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Parser\Name;
16
17/**
18 * Name values class
19 *
20 * @category   Pop
21 * @package    Pop\Parser
22 * @author     Nick Sagona, III <nick@popphp.org>
23 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
24 * @license    https://www.popphp.org/license     New BSD License
25 * @version    1.0.0
26 */
27class NameValues
28{
29
30    /**
31     * A list of salutations
32     * @var array $salutations
33     * */
34    protected static array $salutations = [
35        'mr'         => 'Mr.',
36        'mrs'        => 'Mrs.',
37        'ms'         => 'Ms.',
38        'mx'         => 'Mx.',
39        'miss'       => 'Miss',
40        'master'     => 'Mr.',
41        'mister'     => 'Mr.',
42        'dr'         => 'Dr.',
43        'prof'       => 'Prof.',
44        'rev'        => 'Rev.',
45        'fr'         => 'Fr.',
46        'sir'        => 'Sir',
47        'madam'      => 'Madam',
48        'his honour' => 'His Honour',
49        'her honour' => 'Her Honour',
50    ];
51
52    /**
53     * A list of name suffixes
54     * @var array $suffixes
55     * */
56    protected static array $suffixes = [
57        'jr'     => 'Jr',
58        'junior' => 'Junior',
59        'sr'     => 'Sr',
60        'senior' => 'Senior',
61        'i'      => 'I',
62        'ii'     => 'II',
63        'iii'    => 'III',
64        'iv'     => 'IV',
65        'v'      => 'V',
66        'phd'    => 'PhD',
67        'md'     => 'MD',
68        'esq'    => 'Esq',
69        'jd'     => 'JD',
70        '1st'    => '1st',
71        '2nd'    => '2nd',
72        '3rd'    => '3rd',
73    ];
74
75    /**
76     * A list of lastname prefixes
77     * @var array $lastnamePrefixes
78     * */
79    protected static array $lastnamePrefixes = [
80        'van'    => 'van',
81        'von'    => 'von',
82        'de'     => 'de',
83        'del'    => 'del',
84        'della'  => 'della',
85        'der'    => 'der',
86        'di'     => 'di',
87        'da'     => 'da',
88        'du'     => 'du',
89        'la'     => 'la',
90        'le'     => 'le',
91        'st'     => 'St.',
92        'ter'    => 'ter',
93        'vanden' => 'vanden',
94        'vere'   => 'vere',
95    ];
96
97    /**
98     * A list of nickname-wrapping delimiter pairs (opening => closing)
99     * @var array $nicknameDelimiters
100     * */
101    protected static array $nicknameDelimiters = [
102        '(' => ')',
103        '[' => ']',
104        '{' => '}',
105        '<' => '>',
106        '"' => '"',
107        "'" => "'",
108    ];
109
110    /**
111     * Getter method for accessing the salutations list
112     *
113     * @return array
114     */
115    public function getSalutations(): array
116    {
117        return self::$salutations;
118    }
119
120    /**
121     * Getter method for accessing the suffixes list
122     *
123     * @return array
124     */
125    public function getSuffixes(): array
126    {
127        return self::$suffixes;
128    }
129
130    /**
131     * Getter method for accessing the lastname prefixes list
132     *
133     * @return array
134     */
135    public function getLastnamePrefixes(): array
136    {
137        return self::$lastnamePrefixes;
138    }
139
140    /**
141     * Getter method for accessing the nickname delimiters list
142     *
143     * @return array
144     */
145    public function getNicknameDelimiters(): array
146    {
147        return self::$nicknameDelimiters;
148    }
149
150}