Code Duplication    Length = 8-11 lines in 2 locations

src/Stringy.php 2 locations

@@ 1612-1622 (lines=11) @@
1609
                ),
1610
                $trimChars
1611
            );
1612
      } else {
1613
        $extract = $ellipsis . trim(
1614
                UTF8::substr(
1615
                    $text,
1616
                    $pos_start,
1617
                    $pos_end,
1618
                    $this->encoding
1619
                ),
1620
                $trimChars
1621
            ) . $ellipsis;
1622
      }
1623
1624
    } else {
1625
@@ 1638-1645 (lines=8) @@
1635
          UTF8::strpos($text, '.', $l, $this->encoding)
1636
      );
1637
1638
      if ($pos_end) {
1639
        $extract = rtrim(
1640
                       UTF8::substr($text, 0, $pos_end, $this->encoding),
1641
                       $trimChars
1642
                   ) . $ellipsis;
1643
      } else {
1644
        $extract = $text;
1645
      }
1646
    }
1647
1648
    return static::create($extract, $this->encoding);