Passed
Pull Request — master (#90)
by Jonathan
02:01
created

Ruleset::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Inflector\Rules;
6
7
class Ruleset
8
{
9
    /** @var string[] */
10
    private $rules = [];
11
12
    /** @var string[] */
13
    private $uninflected = [];
14
15
    /** @var string[] */
16
    private $irregular = [];
17
18
    /**
19
     * @param string[] $rules
20
     * @param string[] $uninflected
21
     * @param string[] $irregular
22
     */
23 526
    public function __construct(array $rules, array $uninflected, array $irregular)
24
    {
25 526
        $this->rules       = $rules;
26 526
        $this->uninflected = $uninflected;
27 526
        $this->irregular   = $irregular;
28 526
    }
29
30
    /**
31
     * @return string[]
32
     */
33
    public function getRules() : array
34
    {
35
        return $this->rules;
36
    }
37
38
    /**
39
     * @return string[]
40
     */
41
    public function getUninflected() : array
42
    {
43
        return $this->uninflected;
44
    }
45
46
    /**
47
     * @return string[]
48
     */
49 526
    public function getIrregular() : array
50
    {
51 526
        return $this->irregular;
52
    }
53
54
    /**
55
     * @return mixed[]
56
     */
57 526
    public function toArray() : array
58
    {
59
        return [
60 526
            'rules'       => $this->rules,
61 526
            'uninflected' => $this->uninflected,
62 526
            'irregular'   => $this->irregular,
63
        ];
64
    }
65
}
66