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
@@ 2089-2095 (lines=7) @@
2086
     *
2087
     * @return static
2088
     */
2089
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2090
    {
2091
        return static::create(
2092
            $this->utf8::str_substr_first(
2093
                $this->str,
2094
                $needle,
2095
                $beforeNeedle,
2096
                $this->encoding
2097
            ),
2098
            $this->encoding
@@ 2111-2117 (lines=7) @@
2108
     *
2109
     * @return static
2110
     */
2111
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2112
    {
2113
        return static::create(
2114
            $this->utf8::str_isubstr_first(
2115
                $this->str,
2116
                $needle,
2117
                $beforeNeedle,
2118
                $this->encoding
2119
            ),
2120
            $this->encoding