Code Duplication    Length = 9-13 lines in 2 locations

helpers/Str.php 2 locations

@@ 152-164 (lines=13) @@
149
        return $subject;
150
    }
151
152
    public static function replaceFirst($search, $replace, $subject)
153
    {
154
        if ($search == '') {
155
            return $subject;
156
        }
157
158
        $position = strpos($subject, $search);
159
160
        if ($position !== false) {
161
            return substr_replace($subject, $replace, $position, strlen($search));
162
        }
163
164
        return $subject;
165
    }
166
167
    public static function replaceLast($search, $replace, $subject)
@@ 167-175 (lines=9) @@
164
        return $subject;
165
    }
166
167
    public static function replaceLast($search, $replace, $subject)
168
    {
169
        $position = strrpos($subject, $search);
170
171
        if ($position !== false) {
172
            return substr_replace($subject, $replace, $position, strlen($search));
173
        }
174
175
        return $subject;
176
    }
177
178
    public static function start($value, $prefix)