Code Duplication    Length = 12-12 lines in 2 locations

src/AString.php 2 locations

@@ 215-226 (lines=12) @@
212
        return $this->replaceWhole(\strtr($this->raw, $search, $replace));
213
    }
214
215
    public function trim($mask = " \t\n\r\0\x0B", $flags = self::BOTH_ENDS)
216
    {
217
        // strip out bits we don't understand
218
        $flags &= (self::END | self::BOTH_ENDS);
219
220
        $flagsmap = [
221
            self::START => 'ltrim',
222
            self::END => 'rtrim',
223
            self::BOTH_ENDS => 'trim',
224
        ];
225
        return $this->replaceWhole(\call_user_func($flagsmap[$flags], $this->raw, $mask));
226
    }
227
228
    public function unescape($flags = self::NORMAL)
229
    {
@@ 228-239 (lines=12) @@
225
        return $this->replaceWhole(\call_user_func($flagsmap[$flags], $this->raw, $mask));
226
    }
227
228
    public function unescape($flags = self::NORMAL)
229
    {
230
        // strip out bits we don't understand
231
        $flags &= (self::C_STYLE | self::META);
232
233
        $flagsmap = [
234
            self::NORMAL => 'stripslashes',
235
            self::C_STYLE => 'stripcslashes',
236
            self::META => 'stripslashes',
237
        ];
238
        return $this->replaceWhole(\call_user_func($flagsmap[$flags], $this->raw));
239
    }
240
241
    public function uuDecode()
242
    {