Code Duplication    Length = 7-7 lines in 4 locations

src/Stringy.php 4 locations

@@ 1347-1353 (lines=7) @@
1344
     *
1345
     * @return static
1346
     */
1347
    public function lastSubstringOf(string $needle, bool $beforeNeedle = false): self
1348
    {
1349
        return static::create(
1350
            $this->utf8::str_substr_last(
1351
                $this->str,
1352
                $needle,
1353
                $beforeNeedle,
1354
                $this->encoding
1355
            ),
1356
            $this->encoding
@@ 1369-1375 (lines=7) @@
1366
     *
1367
     * @return static
1368
     */
1369
    public function lastSubstringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
1370
    {
1371
        return static::create(
1372
            $this->utf8::str_isubstr_last(
1373
                $this->str,
1374
                $needle,
1375
                $beforeNeedle,
1376
                $this->encoding
1377
            ),
1378
            $this->encoding
@@ 2221-2227 (lines=7) @@
2218
     *
2219
     * @return static
2220
     */
2221
    public function substringOf(string $needle, bool $beforeNeedle = false): self
2222
    {
2223
        return static::create(
2224
            $this->utf8::str_substr_first(
2225
                $this->str,
2226
                $needle,
2227
                $beforeNeedle,
2228
                $this->encoding
2229
            ),
2230
            $this->encoding
@@ 2243-2249 (lines=7) @@
2240
     *
2241
     * @return static
2242
     */
2243
    public function substringOfIgnoreCase(string $needle, bool $beforeNeedle = false): self
2244
    {
2245
        return static::create(
2246
            $this->utf8::str_isubstr_first(
2247
                $this->str,
2248
                $needle,
2249
                $beforeNeedle,
2250
                $this->encoding
2251
            ),
2252
            $this->encoding