Code Duplication    Length = 7-7 lines in 2 locations

src/Stringy.php 2 locations

@@ 2388-2394 (lines=7) @@
2385
   *
2386
   * @return static <p>Object whose $str has had tabs switched to spaces.</p>
2387
   */
2388
  public function toSpaces(int $tabLength = 4): self
2389
  {
2390
    $spaces = UTF8::str_repeat(' ', $tabLength);
2391
    $str = UTF8::str_replace("\t", $spaces, $this->str);
2392
2393
    return static::create($str, $this->encoding);
2394
  }
2395
2396
  /**
2397
   * Converts each occurrence of some consecutive number of spaces, as
@@ 2405-2411 (lines=7) @@
2402
   *
2403
   * @return static <p>Object whose $str has had spaces switched to tabs.</p>
2404
   */
2405
  public function toTabs(int $tabLength = 4): self
2406
  {
2407
    $spaces = UTF8::str_repeat(' ', $tabLength);
2408
    $str = UTF8::str_replace($spaces, "\t", $this->str);
2409
2410
    return static::create($str, $this->encoding);
2411
  }
2412
2413
  /**
2414
   * Converts the first character of each word in the string to uppercase.