Code Duplication    Length = 8-11 lines in 2 locations

src/Stringy.php 2 locations

@@ 1706-1716 (lines=11) @@
1703
                ),
1704
                $trimChars
1705
            );
1706
      } else {
1707
        $extract = $ellipsis . trim(
1708
                UTF8::substr(
1709
                    $text,
1710
                    $pos_start,
1711
                    $pos_end,
1712
                    $this->encoding
1713
                ),
1714
                $trimChars
1715
            ) . $ellipsis;
1716
      }
1717
1718
    } else {
1719
@@ 1732-1739 (lines=8) @@
1729
          UTF8::strpos($text, '.', $l, $this->encoding)
1730
      );
1731
1732
      if ($pos_end) {
1733
        $extract = rtrim(
1734
                       UTF8::substr($text, 0, $pos_end, $this->encoding),
1735
                       $trimChars
1736
                   ) . $ellipsis;
1737
      } else {
1738
        $extract = $text;
1739
      }
1740
    }
1741
1742
    return static::create($extract, $this->encoding);