Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1525-1534 (lines=10) @@
1522
   *
1523
   * @return static <p>Object with the resulting $str after the replacements.</p>
1524
   */
1525
  public function replace(string $search, string $replacement, bool $caseSensitive = true): self
1526
  {
1527
    if ($caseSensitive) {
1528
      $return = UTF8::str_replace($search, $replacement, $this->str);
1529
    } else {
1530
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1531
    }
1532
1533
    return static::create($return);
1534
  }
1535
1536
  /**
1537
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1545-1554 (lines=10) @@
1542
   *
1543
   * @return static <p>Object with the resulting $str after the replacements.</p>
1544
   */
1545
  public function replaceAll(array $search, $replacement, bool $caseSensitive = true): self
1546
  {
1547
    if ($caseSensitive) {
1548
      $return = UTF8::str_replace($search, $replacement, $this->str);
1549
    } else {
1550
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1551
    }
1552
1553
    return static::create($return);
1554
  }
1555
1556
  /**
1557
   * Replaces all occurrences of $search from the beginning of string with $replacement.