Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1378-1387 (lines=10) @@
1375
   *
1376
   * @return Stringy Object with the resulting $str after the replacements
1377
   */
1378
  public function replace($search, $replacement, $caseSensitive = true)
1379
  {
1380
    if ($caseSensitive) {
1381
      $return = UTF8::str_replace($search, $replacement, $this->str);
1382
    } else {
1383
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1384
    }
1385
1386
    return static::create($return);
1387
  }
1388
1389
  /**
1390
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1398-1407 (lines=10) @@
1395
   *
1396
   * @return Stringy Object with the resulting $str after the replacements
1397
   */
1398
  public function replaceAll(array $search, $replacement, $caseSensitive = true)
1399
  {
1400
    if ($caseSensitive) {
1401
      $return = UTF8::str_replace($search, $replacement, $this->str);
1402
    } else {
1403
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1404
    }
1405
1406
    return static::create($return);
1407
  }
1408
1409
  /**
1410
   * Replaces all occurrences of $search from the beginning of string with $replacement