Code Duplication    Length = 12-12 lines in 2 locations

src/AString.php 2 locations

@@ 244-255 (lines=12) @@
241
        return new self(\strtr($this->raw, $search, $replace));
242
    }
243
244
    public function trim($mask = " \t\n\r\0\x0B", $flags = self::BOTH_ENDS)
245
    {
246
        // strip out bits we don't understand
247
        $flags &= (self::END | self::BOTH_ENDS);
248
249
        $flagsmap = [
250
            self::START => 'ltrim',
251
            self::END => 'rtrim',
252
            self::BOTH_ENDS => 'trim',
253
        ];
254
        return new self(\call_user_func($flagsmap[$flags], $this->raw, $mask));
255
    }
256
257
    public function unescape($flags = self::NORMAL)
258
    {
@@ 257-268 (lines=12) @@
254
        return new self(\call_user_func($flagsmap[$flags], $this->raw, $mask));
255
    }
256
257
    public function unescape($flags = self::NORMAL)
258
    {
259
        // strip out bits we don't understand
260
        $flags &= (self::C_STYLE | self::META);
261
262
        $flagsmap = [
263
            self::NORMAL => 'stripslashes',
264
            self::C_STYLE => 'stripcslashes',
265
            self::META => 'stripslashes',
266
        ];
267
        return new self(\call_user_func($flagsmap[$flags], $this->raw));
268
    }
269
270
    public function uuDecode()
271
    {