Passed
Pull Request — master (#97)
by Jonathan
02:07
created

Uninflected::default()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 10
cp 0
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Inflector\Dictionary\English;
6
7
use Doctrine\Inflector\Rules\Pattern;
8
use Doctrine\Inflector\Rules\Word;
9
10
class Uninflected
11
{
12
    /**
13
     * @return Word[]|Pattern[]
14
     */
15
    private static function default() : iterable
16
    {
17
        yield new Pattern('.*[nrlm]ese');
18
        yield new Pattern('.*deer');
19
        yield new Pattern('.*fish');
20
        yield new Pattern('.*measles');
21
        yield new Pattern('.*ois');
22
        yield new Pattern('.*pox');
23
        yield new Pattern('.*sheep');
24
        yield new Word('police');
25
    }
26
27
    /**
28
     * @return Word[]|Pattern[]
29
     */
30
    public static function singular() : iterable
31
    {
32
        yield from self::default();
33
34
        yield new Pattern('.*ss');
35
        yield new Word('data');
36
        yield new Word('pants');
37
        yield new Word('clothes');
38
    }
39
40
    /**
41
     * @return Word[]|Pattern[]
42
     */
43
    public static function plural() : iterable
44
    {
45
        yield from self::default();
46
47
        yield new Word('people');
48
        yield new Word('middleware');
49
    }
50
}
51