Inflectible::getSingular()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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 23
    public static function getSingular() : iterable
18
    {
19 23
        yield new Transformation(new Pattern('/re$/i'), 'r');
0 ignored issues
show
Bug Best Practice introduced by
The expression yield new Doctrine\Infle...Pattern('/re$/i'), 'r') returns the type Generator which is incompatible with the documented return type Doctrine\Inflector\Rules\Transformation[].
Loading history...
20 23
        yield new Transformation(new Pattern('/er$/i'), '');
21 23
    }
22
23
    /**
24
     * @return Transformation[]
25
     */
26 23
    public static function getPlural() : iterable
27
    {
28 23
        yield new Transformation(new Pattern('/e$/i'), 'er');
0 ignored issues
show
Bug Best Practice introduced by
The expression yield new Doctrine\Infle...Pattern('/e$/i'), 'er') returns the type Generator which is incompatible with the documented return type Doctrine\Inflector\Rules\Transformation[].
Loading history...
29 23
        yield new Transformation(new Pattern('/r$/i'), 're');
30 23
        yield new Transformation(new Pattern('/$/'), 'er');
31 23
    }
32
33
    /**
34
     * @return Substitution[]
35
     */
36 23
    public static function getIrregular() : iterable
37
    {
38 23
        yield new Substitution(new Word('konto'), new Word('konti'));
0 ignored issues
show
Bug Best Practice introduced by
The expression yield new Doctrine\Infle...or\Rules\Word('konti')) returns the type Generator which is incompatible with the documented return type Doctrine\Inflector\Rules\Substitution[].
Loading history...
39 23
    }
40
}
41