Passed
Push — master ( 989424...9f50f4 )
by Jonathan
29s
created

Inflectible   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 27
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPlural() 0 5 1
A getSingular() 0 4 1
A getIrregular() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Inflector\Rules\NorwegianBokmal;
6
7
use Doctrine\Inflector\Rules\Pattern;
8
use Doctrine\Inflector\Rules\Substitution;
9
use Doctrine\Inflector\Rules\Transformation;
10
use Doctrine\Inflector\Rules\Word;
11
12
class Inflectible
13
{
14
    /**
15
     * @return Transformation[]
16
     */
17 22
    public static function getSingular() : iterable
18
    {
19 22
        yield new Transformation(new Pattern('/re$/i'), 'r');
20 22
        yield new Transformation(new Pattern('/er$/i'), '');
21 22
    }
22
23
    /**
24
     * @return Transformation[]
25
     */
26 22
    public static function getPlural() : iterable
27
    {
28 22
        yield new Transformation(new Pattern('/e$/i'), 'er');
29 22
        yield new Transformation(new Pattern('/r$/i'), 're');
30 22
        yield new Transformation(new Pattern('/$/'), 'er');
31 22
    }
32
33
    /**
34
     * @return Substitution[]
35
     */
36 22
    public static function getIrregular() : iterable
37
    {
38 22
        yield new Substitution(new Word('konto'), new Word('konti'));
39 22
    }
40
}
41