Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 1391-1397 (lines=7) @@
1388
     *
1389
     * @return static
1390
     */
1391
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
1392
    {
1393
        return static::create(
1394
            $this->utf8::str_substr_last(
1395
                $this->str,
1396
                $needle,
1397
                $beforeNeedle,
1398
                $this->encoding
1399
            ),
1400
            $this->encoding
@@ 1413-1419 (lines=7) @@
1410
     *
1411
     * @return static
1412
     */
1413
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
1414
    {
1415
        return static::create(
1416
            $this->utf8::str_isubstr_last(
1417
                $this->str,
1418
                $needle,
1419
                $beforeNeedle,
1420
                $this->encoding
1421
            ),
1422
            $this->encoding
@@ 2265-2271 (lines=7) @@
2262
     *
2263
     * @return static
2264
     */
2265
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2266
    {
2267
        return static::create(
2268
            $this->utf8::str_substr_first(
2269
                $this->str,
2270
                $needle,
2271
                $beforeNeedle,
2272
                $this->encoding
2273
            ),
2274
            $this->encoding
@@ 2287-2293 (lines=7) @@
2284
     *
2285
     * @return static
2286
     */
2287
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2288
    {
2289
        return static::create(
2290
            $this->utf8::str_isubstr_first(
2291
                $this->str,
2292
                $needle,
2293
                $beforeNeedle,
2294
                $this->encoding
2295
            ),
2296
            $this->encoding