Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 2556-2562 (lines=7) @@
2553
     *
2554
     * @return static
2555
     */
2556
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
2557
    {
2558
        return static::create(
2559
            $this->utf8::str_substr_last(
2560
                $this->str,
2561
                $needle,
2562
                $beforeNeedle,
2563
                $this->encoding
2564
            ),
2565
            $this->encoding
@@ 2583-2589 (lines=7) @@
2580
     *
2581
     * @return static
2582
     */
2583
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2584
    {
2585
        return static::create(
2586
            $this->utf8::str_isubstr_last(
2587
                $this->str,
2588
                $needle,
2589
                $beforeNeedle,
2590
                $this->encoding
2591
            ),
2592
            $this->encoding
@@ 4165-4171 (lines=7) @@
4162
     *
4163
     * @return static
4164
     */
4165
    public function substringOf(string $needle, bool $beforeNeedle = false): self
4166
    {
4167
        return static::create(
4168
            $this->utf8::str_substr_first(
4169
                $this->str,
4170
                $needle,
4171
                $beforeNeedle,
4172
                $this->encoding
4173
            ),
4174
            $this->encoding
@@ 4192-4198 (lines=7) @@
4189
     *
4190
     * @return static
4191
     */
4192
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
4193
    {
4194
        return static::create(
4195
            $this->utf8::str_isubstr_first(
4196
                $this->str,
4197
                $needle,
4198
                $beforeNeedle,
4199
                $this->encoding
4200
            ),
4201
            $this->encoding