Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 1629-1635 (lines=7) @@
1626
     *
1627
     * @return static
1628
     */
1629
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
1630
    {
1631
        return static::create(
1632
            $this->utf8::str_substr_last(
1633
                $this->str,
1634
                $needle,
1635
                $beforeNeedle,
1636
                $this->encoding
1637
            ),
1638
            $this->encoding
@@ 1653-1659 (lines=7) @@
1650
     *
1651
     * @return static
1652
     */
1653
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
1654
    {
1655
        return static::create(
1656
            $this->utf8::str_isubstr_last(
1657
                $this->str,
1658
                $needle,
1659
                $beforeNeedle,
1660
                $this->encoding
1661
            ),
1662
            $this->encoding
@@ 2626-2632 (lines=7) @@
2623
     *
2624
     * @return static
2625
     */
2626
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2627
    {
2628
        return static::create(
2629
            $this->utf8::str_substr_first(
2630
                $this->str,
2631
                $needle,
2632
                $beforeNeedle,
2633
                $this->encoding
2634
            ),
2635
            $this->encoding
@@ 2650-2656 (lines=7) @@
2647
     *
2648
     * @return static
2649
     */
2650
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2651
    {
2652
        return static::create(
2653
            $this->utf8::str_isubstr_first(
2654
                $this->str,
2655
                $needle,
2656
                $beforeNeedle,
2657
                $this->encoding
2658
            ),
2659
            $this->encoding