Code Duplication    Length = 7-8 lines in 2 locations

src/AString.php 1 location

@@ 200-206 (lines=7) @@
197
        return new self(\str_replace($search, $replace, $this->raw));
198
    }
199
200
    public function replaceSubstr($replacement, $start, $length = null)
201
    {
202
        if ($length === null) {
203
            $length = $this->length();
204
        }
205
        return new self(\substr_replace($this->raw, $replacement, $start, $length));
206
    }
207
208
    public function resetToken()
209
    {

src/AStringBuilder.php 1 location

@@ 67-74 (lines=8) @@
64
        return $this;
65
    }
66
67
    public function replaceSubstr($replacement, $start, $length = null)
68
    {
69
        if ($length === null) {
70
            $length = $this->length();
71
        }
72
        $this->raw = \substr_replace($this->raw, $replacement, $start, $length);
73
        return $this;
74
    }
75
76
    public function replaceWhole($replacement = '')
77
    {