Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 2089-2095 (lines=7) @@
2086
     *
2087
     * @return static
2088
     */
2089
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2090
    {
2091
        return static::create(
2092
            $this->utf8::str_substr_first(
2093
                $this->str,
2094
                $needle,
2095
                $beforeNeedle,
2096
                $this->encoding
2097
            ),
2098
            $this->encoding
@@ 2111-2117 (lines=7) @@
2108
     *
2109
     * @return static
2110
     */
2111
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2112
    {
2113
        return static::create(
2114
            $this->utf8::str_isubstr_first(
2115
                $this->str,
2116
                $needle,
2117
                $beforeNeedle,
2118
                $this->encoding
2119
            ),
2120
            $this->encoding
@@ 1206-1212 (lines=7) @@
1203
     *
1204
     * @return static
1205
     */
1206
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
1207
    {
1208
        return static::create(
1209
            $this->utf8::str_substr_last(
1210
                $this->str,
1211
                $needle,
1212
                $beforeNeedle,
1213
                $this->encoding
1214
            ),
1215
            $this->encoding
@@ 1228-1234 (lines=7) @@
1225
     *
1226
     * @return static
1227
     */
1228
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
1229
    {
1230
        return static::create(
1231
            $this->utf8::str_isubstr_last(
1232
                $this->str,
1233
                $needle,
1234
                $beforeNeedle,
1235
                $this->encoding
1236
            ),
1237
            $this->encoding