Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 2559-2565 (lines=7) @@
2556
     *
2557
     * @return static
2558
     */
2559
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
2560
    {
2561
        return static::create(
2562
            $this->utf8::str_substr_last(
2563
                $this->str,
2564
                $needle,
2565
                $beforeNeedle,
2566
                $this->encoding
2567
            ),
2568
            $this->encoding
@@ 2586-2592 (lines=7) @@
2583
     *
2584
     * @return static
2585
     */
2586
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2587
    {
2588
        return static::create(
2589
            $this->utf8::str_isubstr_last(
2590
                $this->str,
2591
                $needle,
2592
                $beforeNeedle,
2593
                $this->encoding
2594
            ),
2595
            $this->encoding
@@ 4173-4179 (lines=7) @@
4170
     *
4171
     * @return static
4172
     */
4173
    public function substringOf(string $needle, bool $beforeNeedle = false): self
4174
    {
4175
        return static::create(
4176
            $this->utf8::str_substr_first(
4177
                $this->str,
4178
                $needle,
4179
                $beforeNeedle,
4180
                $this->encoding
4181
            ),
4182
            $this->encoding
@@ 4200-4206 (lines=7) @@
4197
     *
4198
     * @return static
4199
     */
4200
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
4201
    {
4202
        return static::create(
4203
            $this->utf8::str_isubstr_first(
4204
                $this->str,
4205
                $needle,
4206
                $beforeNeedle,
4207
                $this->encoding
4208
            ),
4209
            $this->encoding