Code Duplication    Length = 6-8 lines in 2 locations

src/Money.php 2 locations

@@ 98-103 (lines=6) @@
95
    {
96
        $result = '';
97
        $gree = strlen($intPart) - 1;
98
        if ($intPart > 0) {
99
            for ($i = 0; $i < strlen($intPart); ++$i) {
100
                $num = $intPart[$i];
101
                $result .= $this->uppers[$num].$this->grees[$gree--];
102
            }
103
        }
104
105
        $result = str_replace('零亿', '亿零', $result);
106
        $result = str_replace('零万', '万零', $result);
@@ 130-137 (lines=8) @@
127
    private function getDecimalPart($decimalPart)
128
    {
129
        $result = '';
130
        if ($decimalPart > 0) {
131
            $unit = strlen($decimalPart) - 1;
132
            for ($i = 0; $i < strlen($decimalPart); ++$i) {
133
                $num = $decimalPart[$i];
134
                $result .= $this->uppers[$num].$this->units[$unit--];
135
            }
136
        }
137
        $result = str_replace('零分', '', $result);
138
        if ($this->thanOne) {
139
            $result = str_replace('零角', '零', $result);
140
        } else {