Completed
Pull Request — master (#40)
by
unknown
01:17
created

English   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 96
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getSuffixes() 0 4 1
A getSalutations() 0 4 1
A getLastnamePrefixes() 0 4 1
A getExtensions() 0 4 1
A getTitles() 0 4 1
A getCompanies() 0 4 1
1
<?php
2
3
namespace TheIconic\NameParser\Language;
4
5
use TheIconic\NameParser\LanguageInterface;
6
7
class English implements LanguageInterface
8
{
9
    const SUFFIXES = [
10
        '1st' => '1st',
11
        '2nd' => '2nd',
12
        '3rd' => '3rd',
13
        '4th' => '4th',
14
        '5th' => '5th',
15
        'i' => 'I',
16
        'ii' => 'II',
17
        'iii' => 'III',
18
        'iv' => 'IV',
19
        'v' => 'V',
20
        'apr' => 'APR',
21
        'cme' => 'CME',
22
        'dmd' => 'DMD',
23
        'jr' => 'Jr',
24
        'junior' => 'Junior',
25
        'ma' => 'MA',
26
        'md' => 'MD',
27
        'pe' => 'PE',
28
        'phd' => 'PhD',
29
        'rph' => 'RPh',
30
        'senior' => 'Senior',
31
        'sr' => 'Sr',
32
    ];
33
34
    const SALUTATIONS = [
35
        'dr' => 'Dr.',
36
        'fr' => 'Fr.',
37
        'madam' => 'Madam',
38
        'master' => 'Mr.',
39
        'miss' => 'Miss',
40
        'mister' => 'Mr.',
41
        'mr' => 'Mr.',
42
        'mrs' => 'Mrs.',
43
        'ms' => 'Ms.',
44
        'mx' => 'Mx.',
45
        'rev' => 'Rev.',
46
        'sir' => 'Sir',
47
        'prof' => 'Prof.',
48
        'his honour' => 'His Honour',
49
        'her honour' => 'Her Honour'
50
    ];
51
52
    const LASTNAME_PREFIXES = [
53
        'da' => 'da',
54
        'de' => 'de',
55
        'del' => 'del',
56
        'della' => 'della',
57
        'der' => 'der',
58
        'di' => 'di',
59
        'du' => 'du',
60
        'la' => 'la',
61
        'pietro' => 'pietro',
62
        'st' => 'st.',
63
        'ter' => 'ter',
64
        'van' => 'van',
65
        'vanden' => 'vanden',
66
        'vere' => 'vere',
67
        'von' => 'von',
68
    ];
69
70
    public function getSuffixes(): array
71
    {
72
        return self::SUFFIXES;
73
    }
74
75
    public function getSalutations(): array
76
    {
77
        return self::SALUTATIONS;
78
    }
79
80
    public function getLastnamePrefixes(): array
81
    {
82
        return self::LASTNAME_PREFIXES;
83
    }
84
85
    // see German for further information
86
    public function getExtensions(): array
87
    {
88
        return [];
89
    }
90
91
    // see German for further information
92
    public function getTitles(): array
93
    {
94
        return [];
95
    }
96
97
    // see German for further information
98
    public function getCompanies(): array
99
    {
100
        return [];
101
    }
102
}
103
104