Inflectible   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPlural() 0 4 1
A getIrregular() 0 5 1
A getSingular() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Inflector\Rules\Turkish;
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 19
    public static function getSingular() : iterable
18
    {
19 19
        yield new Transformation(new Pattern('/l[ae]r$/i'), '');
0 ignored issues
show
Bug Best Practice introduced by
The expression yield new Doctrine\Infle...tern('/l[ae]r$/i'), '') returns the type Generator which is incompatible with the documented return type Doctrine\Inflector\Rules\Transformation[].
Loading history...
20 19
    }
21
22
    /**
23
     * @return Transformation[]
24
     */
25 19
    public static function getPlural() : iterable
26
    {
27 19
        yield new Transformation(new Pattern('/([eöiü][^aoıueöiü]{0,6})$/u'), '\1ler');
0 ignored issues
show
Bug Best Practice introduced by
The expression yield new Doctrine\Infle... returns the type Generator which is incompatible with the documented return type Doctrine\Inflector\Rules\Transformation[].
Loading history...
28 19
        yield new Transformation(new Pattern('/([aoıu][^aoıueöiü]{0,6})$/u'), '\1lar');
29 19
    }
30
31
    /**
32
     * @return Substitution[]
33
     */
34 19
    public static function getIrregular() : iterable
35
    {
36 19
        yield new Substitution(new Word('ben'), new Word('biz'));
0 ignored issues
show
Bug Best Practice introduced by
The expression yield new Doctrine\Infle...ctor\Rules\Word('biz')) returns the type Generator which is incompatible with the documented return type Doctrine\Inflector\Rules\Substitution[].
Loading history...
37 19
        yield new Substitution(new Word('sen'), new Word('siz'));
38 19
        yield new Substitution(new Word('o'), new Word('onlar'));
39 19
    }
40
}
41