Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1312-1321 (lines=10) @@
1309
   *
1310
   * @return Stringy Object with the resulting $str after the replacements
1311
   */
1312
  public function replace($search, $replacement, $caseSensitive = true)
1313
  {
1314
    if ($caseSensitive) {
1315
      $return = UTF8::str_replace($search, $replacement, $this->str);
1316
    } else {
1317
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1318
    }
1319
1320
    return static::create($return);
1321
  }
1322
1323
  /**
1324
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1332-1341 (lines=10) @@
1329
   *
1330
   * @return Stringy Object with the resulting $str after the replacements
1331
   */
1332
  public function replaceAll(array $search, $replacement, $caseSensitive = true)
1333
  {
1334
    if ($caseSensitive) {
1335
      $return = UTF8::str_replace($search, $replacement, $this->str);
1336
    } else {
1337
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1338
    }
1339
1340
    return static::create($return);
1341
  }
1342
1343
  /**
1344
   * Replaces all occurrences of $search from the beginning of string with $replacement