Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 2066-2072 (lines=7) @@
2063
     *
2064
     * @return static
2065
     */
2066
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
2067
    {
2068
        return static::create(
2069
            $this->utf8::str_substr_last(
2070
                $this->str,
2071
                $needle,
2072
                $beforeNeedle,
2073
                $this->encoding
2074
            ),
2075
            $this->encoding
@@ 2090-2096 (lines=7) @@
2087
     *
2088
     * @return static
2089
     */
2090
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2091
    {
2092
        return static::create(
2093
            $this->utf8::str_isubstr_last(
2094
                $this->str,
2095
                $needle,
2096
                $beforeNeedle,
2097
                $this->encoding
2098
            ),
2099
            $this->encoding
@@ 3451-3457 (lines=7) @@
3448
     *
3449
     * @return static
3450
     */
3451
    public function substringOf(string $needle, bool $beforeNeedle = false): self
3452
    {
3453
        return static::create(
3454
            $this->utf8::str_substr_first(
3455
                $this->str,
3456
                $needle,
3457
                $beforeNeedle,
3458
                $this->encoding
3459
            ),
3460
            $this->encoding
@@ 3475-3481 (lines=7) @@
3472
     *
3473
     * @return static
3474
     */
3475
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
3476
    {
3477
        return static::create(
3478
            $this->utf8::str_isubstr_first(
3479
                $this->str,
3480
                $needle,
3481
                $beforeNeedle,
3482
                $this->encoding
3483
            ),
3484
            $this->encoding