Code Duplication    Length = 8-11 lines in 2 locations

src/Stringy.php 2 locations

@@ 1616-1626 (lines=11) @@
1613
                ),
1614
                $trimChars
1615
            );
1616
      } else {
1617
        $extract = $ellipsis . trim(
1618
                UTF8::substr(
1619
                    $text,
1620
                    $pos_start,
1621
                    $pos_end,
1622
                    $this->encoding
1623
                ),
1624
                $trimChars
1625
            ) . $ellipsis;
1626
      }
1627
1628
    } else {
1629
@@ 1642-1649 (lines=8) @@
1639
          UTF8::strpos($text, '.', $l, $this->encoding)
1640
      );
1641
1642
      if ($pos_end) {
1643
        $extract = rtrim(
1644
                       UTF8::substr($text, 0, $pos_end, $this->encoding),
1645
                       $trimChars
1646
                   ) . $ellipsis;
1647
      } else {
1648
        $extract = $text;
1649
      }
1650
    }
1651
1652
    return static::create($extract, $this->encoding);