Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 2087-2093 (lines=7) @@
2084
     *
2085
     * @return static
2086
     */
2087
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
2088
    {
2089
        return static::create(
2090
            $this->utf8::str_substr_last(
2091
                $this->str,
2092
                $needle,
2093
                $beforeNeedle,
2094
                $this->encoding
2095
            ),
2096
            $this->encoding
@@ 2111-2117 (lines=7) @@
2108
     *
2109
     * @return static
2110
     */
2111
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2112
    {
2113
        return static::create(
2114
            $this->utf8::str_isubstr_last(
2115
                $this->str,
2116
                $needle,
2117
                $beforeNeedle,
2118
                $this->encoding
2119
            ),
2120
            $this->encoding
@@ 3470-3476 (lines=7) @@
3467
     *
3468
     * @return static
3469
     */
3470
    public function substringOf(string $needle, bool $beforeNeedle = false): self
3471
    {
3472
        return static::create(
3473
            $this->utf8::str_substr_first(
3474
                $this->str,
3475
                $needle,
3476
                $beforeNeedle,
3477
                $this->encoding
3478
            ),
3479
            $this->encoding
@@ 3494-3500 (lines=7) @@
3491
     *
3492
     * @return static
3493
     */
3494
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
3495
    {
3496
        return static::create(
3497
            $this->utf8::str_isubstr_first(
3498
                $this->str,
3499
                $needle,
3500
                $beforeNeedle,
3501
                $this->encoding
3502
            ),
3503
            $this->encoding