Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1354-1363 (lines=10) @@
1351
   *
1352
   * @return Stringy Object with the resulting $str after the replacements
1353
   */
1354
  public function replace($search, $replacement, $caseSensitive = true)
1355
  {
1356
    if ($caseSensitive) {
1357
      $return = UTF8::str_replace($search, $replacement, $this->str);
1358
    } else {
1359
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1360
    }
1361
1362
    return static::create($return);
1363
  }
1364
1365
  /**
1366
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1374-1383 (lines=10) @@
1371
   *
1372
   * @return Stringy Object with the resulting $str after the replacements
1373
   */
1374
  public function replaceAll(array $search, $replacement, $caseSensitive = true)
1375
  {
1376
    if ($caseSensitive) {
1377
      $return = UTF8::str_replace($search, $replacement, $this->str);
1378
    } else {
1379
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1380
    }
1381
1382
    return static::create($return);
1383
  }
1384
1385
  /**
1386
   * Replaces all occurrences of $search from the beginning of string with $replacement