Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 1249-1255 (lines=7) @@
1246
     *
1247
     * @return static
1248
     */
1249
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
1250
    {
1251
        return static::create(
1252
            $this->utf8::str_substr_last(
1253
                $this->str,
1254
                $needle,
1255
                $beforeNeedle,
1256
                $this->encoding
1257
            ),
1258
            $this->encoding
@@ 1271-1277 (lines=7) @@
1268
     *
1269
     * @return static
1270
     */
1271
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
1272
    {
1273
        return static::create(
1274
            $this->utf8::str_isubstr_last(
1275
                $this->str,
1276
                $needle,
1277
                $beforeNeedle,
1278
                $this->encoding
1279
            ),
1280
            $this->encoding
@@ 2260-2266 (lines=7) @@
2257
     *
2258
     * @return static
2259
     */
2260
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2261
    {
2262
        return static::create(
2263
            $this->utf8::str_substr_first(
2264
                $this->str,
2265
                $needle,
2266
                $beforeNeedle,
2267
                $this->encoding
2268
            ),
2269
            $this->encoding
@@ 2282-2288 (lines=7) @@
2279
     *
2280
     * @return static
2281
     */
2282
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2283
    {
2284
        return static::create(
2285
            $this->utf8::str_isubstr_first(
2286
                $this->str,
2287
                $needle,
2288
                $beforeNeedle,
2289
                $this->encoding
2290
            ),
2291
            $this->encoding