Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 1192-1198 (lines=7) @@
1189
     *
1190
     * @return static
1191
     */
1192
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
1193
    {
1194
        return static::create(
1195
            $this->utf8::str_substr_last(
1196
                $this->str,
1197
                $needle,
1198
                $beforeNeedle,
1199
                $this->encoding
1200
            ),
1201
            $this->encoding
@@ 1214-1220 (lines=7) @@
1211
     *
1212
     * @return static
1213
     */
1214
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
1215
    {
1216
        return static::create(
1217
            $this->utf8::str_isubstr_last(
1218
                $this->str,
1219
                $needle,
1220
                $beforeNeedle,
1221
                $this->encoding
1222
            ),
1223
            $this->encoding
@@ 2084-2090 (lines=7) @@
2081
     *
2082
     * @return static
2083
     */
2084
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2085
    {
2086
        return static::create(
2087
            $this->utf8::str_substr_first(
2088
                $this->str,
2089
                $needle,
2090
                $beforeNeedle,
2091
                $this->encoding
2092
            ),
2093
            $this->encoding
@@ 2106-2112 (lines=7) @@
2103
     *
2104
     * @return static
2105
     */
2106
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2107
    {
2108
        return static::create(
2109
            $this->utf8::str_isubstr_first(
2110
                $this->str,
2111
                $needle,
2112
                $beforeNeedle,
2113
                $this->encoding
2114
            ),
2115
            $this->encoding