Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1403-1412 (lines=10) @@
1400
   *
1401
   * @return static  Object with the resulting $str after the replacements
1402
   */
1403
  public function replace($search, $replacement, $caseSensitive = true)
1404
  {
1405
    if ($caseSensitive) {
1406
      $return = UTF8::str_replace($search, $replacement, $this->str);
1407
    } else {
1408
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1409
    }
1410
1411
    return static::create($return);
1412
  }
1413
1414
  /**
1415
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1423-1432 (lines=10) @@
1420
   *
1421
   * @return static  Object with the resulting $str after the replacements
1422
   */
1423
  public function replaceAll(array $search, $replacement, $caseSensitive = true)
1424
  {
1425
    if ($caseSensitive) {
1426
      $return = UTF8::str_replace($search, $replacement, $this->str);
1427
    } else {
1428
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1429
    }
1430
1431
    return static::create($return);
1432
  }
1433
1434
  /**
1435
   * Replaces all occurrences of $search from the beginning of string with $replacement