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 replaceWhole($replacement = '')
209
    {

src/AStringBuilder.php 1 location

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