Passed
Push — main ( 502e97...5fe35e )
by Alex
01:17
created

Resource   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 18
c 1
b 0
f 0
dl 0
loc 97
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getUncountable() 0 3 1
A setUncountable() 0 3 1
A getSingular() 0 3 1
A setPlural() 0 3 1
A __construct() 0 6 1
A getIrregular() 0 3 1
A setSingular() 0 3 1
A getPlural() 0 3 1
A setIrregular() 0 3 1
1
<?php
2
3
namespace Erykai\Pluralize;
4
5
/**
6
 * Resource Pluralize
7
 */
8
class Resource
9
{
10
    use TraitPluralize;
11
12
    /**
13
     * @var array
14
     */
15
    private array $plural;
16
17
    /**
18
     * @var array
19
     */
20
    private array $singular;
21
22
    /**
23
     * @var array
24
     */
25
    private array $irregular;
26
27
    /**
28
     * @var array
29
     */
30
    private array $uncountable;
31
32
    /**
33
     * sets
34
     */
35
    public function __construct()
36
    {
37
        $this->setPlural($this->rulePlural());
38
        $this->setSingular($this->ruleSingular());
39
        $this->setIrregular($this->ruleIrregular());
40
        $this->setUncountable($this->ruleUncountable());
41
    }
42
43
    /**
44
     * @return string[]
45
     */
46
    protected function getPlural(): array
47
    {
48
        return $this->plural;
49
    }
50
51
    /**
52
     * @param string[] $plural
53
     */
54
    private function setPlural(array $plural): void
55
    {
56
        $this->plural = $plural;
57
    }
58
59
    /**
60
     * @return string[]
61
     */
62
    protected function getSingular(): array
63
    {
64
        return $this->singular;
65
    }
66
67
    /**
68
     * @param string[] $singular
69
     */
70
    private function setSingular(array $singular): void
71
    {
72
        $this->singular = $singular;
73
    }
74
75
    /**
76
     * @return string[]
77
     */
78
    protected function getIrregular(): array
79
    {
80
        return $this->irregular;
81
    }
82
83
    /**
84
     * @param string[] $irregular
85
     */
86
    private function setIrregular(array $irregular): void
87
    {
88
        $this->irregular = $irregular;
89
    }
90
91
    /**
92
     * @return string[]
93
     */
94
    protected function getUncountable(): array
95
    {
96
        return $this->uncountable;
97
    }
98
99
    /**
100
     * @param string[] $uncountable
101
     */
102
    private function setUncountable(array $uncountable): void
103
    {
104
        $this->uncountable = $uncountable;
105
    }
106
107
108
}