Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1409-1418 (lines=10) @@
1406
   *
1407
   * @return static  Object with the resulting $str after the replacements
1408
   */
1409
  public function replace($search, $replacement, $caseSensitive = true)
1410
  {
1411
    if ($caseSensitive) {
1412
      $return = UTF8::str_replace($search, $replacement, $this->str);
1413
    } else {
1414
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1415
    }
1416
1417
    return static::create($return);
1418
  }
1419
1420
  /**
1421
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1429-1438 (lines=10) @@
1426
   *
1427
   * @return static  Object with the resulting $str after the replacements
1428
   */
1429
  public function replaceAll(array $search, $replacement, $caseSensitive = true)
1430
  {
1431
    if ($caseSensitive) {
1432
      $return = UTF8::str_replace($search, $replacement, $this->str);
1433
    } else {
1434
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1435
    }
1436
1437
    return static::create($return);
1438
  }
1439
1440
  /**
1441
   * Replaces all occurrences of $search from the beginning of string with $replacement