Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 1192-1198 (lines=7) @@
1189
     *
1190
     * @return static
1191
     */
1192
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
1193
    {
1194
        return static::create(
1195
            $this->utf8::str_substr_last(
1196
                $this->str,
1197
                $needle,
1198
                $beforeNeedle,
1199
                $this->encoding
1200
            ),
1201
            $this->encoding
@@ 1214-1220 (lines=7) @@
1211
     *
1212
     * @return static
1213
     */
1214
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
1215
    {
1216
        return static::create(
1217
            $this->utf8::str_isubstr_last(
1218
                $this->str,
1219
                $needle,
1220
                $beforeNeedle,
1221
                $this->encoding
1222
            ),
1223
            $this->encoding
@@ 2100-2106 (lines=7) @@
2097
     *
2098
     * @return static
2099
     */
2100
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2101
    {
2102
        return static::create(
2103
            $this->utf8::str_substr_first(
2104
                $this->str,
2105
                $needle,
2106
                $beforeNeedle,
2107
                $this->encoding
2108
            ),
2109
            $this->encoding
@@ 2122-2128 (lines=7) @@
2119
     *
2120
     * @return static
2121
     */
2122
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2123
    {
2124
        return static::create(
2125
            $this->utf8::str_isubstr_first(
2126
                $this->str,
2127
                $needle,
2128
                $beforeNeedle,
2129
                $this->encoding
2130
            ),
2131
            $this->encoding