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
@@ 3453-3459 (lines=7) @@
3450
     *
3451
     * @return static
3452
     */
3453
    public function substringOf(string $needle, bool $beforeNeedle = false): self
3454
    {
3455
        return static::create(
3456
            $this->utf8::str_substr_first(
3457
                $this->str,
3458
                $needle,
3459
                $beforeNeedle,
3460
                $this->encoding
3461
            ),
3462
            $this->encoding
@@ 3477-3483 (lines=7) @@
3474
     *
3475
     * @return static
3476
     */
3477
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
3478
    {
3479
        return static::create(
3480
            $this->utf8::str_isubstr_first(
3481
                $this->str,
3482
                $needle,
3483
                $beforeNeedle,
3484
                $this->encoding
3485
            ),
3486
            $this->encoding