Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1306-1315 (lines=10) @@
1303
   *
1304
   * @return Stringy Object with the resulting $str after the replacements
1305
   */
1306
  public function replace($search, $replacement, $caseSensitive = true)
1307
  {
1308
    if ($caseSensitive) {
1309
      $return = UTF8::str_replace($search, $replacement, $this->str);
1310
    } else {
1311
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1312
    }
1313
1314
    return static::create($return);
1315
  }
1316
1317
  /**
1318
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1326-1335 (lines=10) @@
1323
   *
1324
   * @return Stringy Object with the resulting $str after the replacements
1325
   */
1326
  public function replaceAll(array $search, $replacement, $caseSensitive = true)
1327
  {
1328
    if ($caseSensitive) {
1329
      $return = UTF8::str_replace($search, $replacement, $this->str);
1330
    } else {
1331
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1332
    }
1333
1334
    return static::create($return);
1335
  }
1336
1337
  /**
1338
   * Replaces all occurrences of $search from the beginning of string with $replacement