Code Duplication    Length = 3-5 lines in 2 locations

src/Text.php 2 locations

@@ 99-103 (lines=5) @@
96
    
97
    public static function pluralize($text)
98
    {
99
        if(substr($text, -1) == 'y') {
100
            return substr($text, 0, -1) . 'ies';
101
        } else {
102
            return $text . 's';
103
        }
104
    }
105
    
106
    public static function singularize($text)
@@ 110-112 (lines=3) @@
107
    {
108
        if(substr($text, -1) == 's') {
109
            return substr($text, 0, -1);
110
        } elseif (substr($text, -3) == 'ies') {
111
            return substr($text, 0, -3) . 'y';
112
        }
113
        return $text;
114
    }
115
}