Code Duplication    Length = 12-14 lines in 2 locations

src/Stringy.php 2 locations

@@ 702-715 (lines=14) @@
699
   *
700
   * @return Stringy Object with the first character of $str being upper case
701
   */
702
  public function upperCaseFirst()
703
  {
704
    $first = UTF8::substr($this->str, 0, 1, $this->encoding);
705
    $rest = UTF8::substr(
706
        $this->str,
707
        1,
708
        $this->length() - 1,
709
        $this->encoding
710
    );
711
712
    $str = UTF8::strtoupper($first, $this->encoding) . $rest;
713
714
    return static::create($str, $this->encoding);
715
  }
716
717
  /**
718
   * Returns the index of the last occurrence of $needle in the string,
@@ 2103-2114 (lines=12) @@
2100
   *
2101
   * @return Stringy Object with the first character of $str being lower case
2102
   */
2103
  public function lowerCaseFirst()
2104
  {
2105
    $first = UTF8::substr($this->str, 0, 1, $this->encoding);
2106
    $rest = UTF8::substr(
2107
        $this->str, 1, $this->length() - 1,
2108
        $this->encoding
2109
    );
2110
2111
    $str = UTF8::strtolower($first, $this->encoding) . $rest;
2112
2113
    return static::create($str, $this->encoding);
2114
  }
2115
2116
  /**
2117
   * Shorten the string after $length, but also after the next word.