Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 1296-1305 (lines=10) @@
1293
   *
1294
   * @return Stringy Object with the resulting $str after the replacements
1295
   */
1296
  public function replace($search, $replacement, $caseSensitive = true)
1297
  {
1298
    if ($caseSensitive) {
1299
      $return = UTF8::str_replace($search, $replacement, $this->str);
1300
    } else {
1301
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1302
    }
1303
1304
    return static::create($return);
1305
  }
1306
1307
  /**
1308
   * Replaces all occurrences of $search in $str by $replacement.
@@ 1316-1325 (lines=10) @@
1313
   *
1314
   * @return Stringy Object with the resulting $str after the replacements
1315
   */
1316
  public function replaceAll(array $search, $replacement, $caseSensitive = true)
1317
  {
1318
    if ($caseSensitive) {
1319
      $return = UTF8::str_replace($search, $replacement, $this->str);
1320
    } else {
1321
      $return = UTF8::str_ireplace($search, $replacement, $this->str);
1322
    }
1323
1324
    return static::create($return);
1325
  }
1326
1327
  /**
1328
   * Replaces all occurrences of $search from the beginning of string with $replacement