Code Duplication    Length = 12-12 lines in 2 locations

src/AString.php 2 locations

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