Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

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