Completed
Pull Request — master (#90)
by Jonathan
02:06
created

Uninflected::getUninflected()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Inflector\Rules;
6
7
class Uninflected
8
{
9
    /**
10
     * Default words that should not be inflected.
11
     *
12
     * @var string[]
13
     */
14
    public const DEFAULT = [
15
        '.*?media',
16
        'Amoyese',
17
        'audio',
18
        'bison',
19
        'Borghese',
20
        'bream',
21
        'breeches',
22
        'britches',
23
        'buffalo',
24
        'cantus',
25
        'carp',
26
        'chassis',
27
        'clippers',
28
        'cod',
29
        'coitus',
30
        'compensation',
31
        'Congoese',
32
        'contretemps',
33
        'coreopsis',
34
        'corps',
35
        'data',
36
        'debris',
37
        'deer',
38
        'diabetes',
39
        'djinn',
40
        'education',
41
        'eland',
42
        'elk',
43
        'emoji',
44
        'equipment',
45
        'evidence',
46
        'Faroese',
47
        'feedback',
48
        'fish',
49
        'flounder',
50
        'Foochowese',
51
        'Furniture',
52
        'furniture',
53
        'gallows',
54
        'Genevese',
55
        'Genoese',
56
        'Gilbertese',
57
        'gold',
58
        'headquarters',
59
        'herpes',
60
        'hijinks',
61
        'Hottentotese',
62
        'information',
63
        'innings',
64
        'jackanapes',
65
        'jedi',
66
        'Kiplingese',
67
        'knowledge',
68
        'Kongoese',
69
        'love',
70
        'Lucchese',
71
        'Luggage',
72
        'mackerel',
73
        'Maltese',
74
        'metadata',
75
        'mews',
76
        'moose',
77
        'mumps',
78
        'Nankingese',
79
        'news',
80
        'nexus',
81
        'Niasese',
82
        'nutrition',
83
        'offspring',
84
        'Pekingese',
85
        'Piedmontese',
86
        'pincers',
87
        'Pistoiese',
88
        'plankton',
89
        'pliers',
90
        'pokemon',
91
        'police',
92
        'Portuguese',
93
        'proceedings',
94
        'rabies',
95
        'rain',
96
        'rhinoceros',
97
        'rice',
98
        'salmon',
99
        'Sarawakese',
100
        'scissors',
101
        'sea[- ]bass',
102
        'series',
103
        'Shavese',
104
        'shears',
105
        'sheep',
106
        'siemens',
107
        'species',
108
        'staff',
109
        'swine',
110
        'traffic',
111
        'trousers',
112
        'trout',
113
        'tuna',
114
        'us',
115
        'Vermontese',
116
        'Wenchowese',
117
        'wheat',
118
        'whiting',
119
        'wildebeest',
120
        'Yengeese',
121
    ];
122
123
    /** @var string[] */
124
    private $uninflected;
125
126
    /**
127
     * @param string[] $uninflected
128
     */
129 526
    public function __construct(array $uninflected = [])
130
    {
131 526
        $this->uninflected = $uninflected;
132 526
    }
133
134
    /**
135
     * @return string[]
136
     */
137 526
    public function getUninflected() : array
138
    {
139 526
        return $this->uninflected;
140
    }
141
142
    public function addUninflected(string $word) : void
143
    {
144
        $this->uninflected[] = $word;
145
    }
146
}
147