Code Duplication    Length = 7-7 lines in 2 locations

src/Stringy.php 2 locations

@@ 2241-2247 (lines=7) @@
2238
   *
2239
   * @return static <p>Object whose $str has had tabs switched to spaces.</p>
2240
   */
2241
  public function toSpaces(int $tabLength = 4): Stringy
2242
  {
2243
    $spaces = UTF8::str_repeat(' ', $tabLength);
2244
    $str = UTF8::str_replace("\t", $spaces, $this->str);
2245
2246
    return static::create($str, $this->encoding);
2247
  }
2248
2249
  /**
2250
   * Converts each occurrence of some consecutive number of spaces, as
@@ 2258-2264 (lines=7) @@
2255
   *
2256
   * @return static <p>Object whose $str has had spaces switched to tabs.</p>
2257
   */
2258
  public function toTabs(int $tabLength = 4): Stringy
2259
  {
2260
    $spaces = UTF8::str_repeat(' ', $tabLength);
2261
    $str = UTF8::str_replace($spaces, "\t", $this->str);
2262
2263
    return static::create($str, $this->encoding);
2264
  }
2265
2266
  /**
2267
   * Converts the first character of each word in the string to uppercase.