Code Duplication    Length = 8-11 lines in 2 locations

src/Stringy.php 2 locations

@@ 1919-1929 (lines=11) @@
1916
                ),
1917
                $trimChars
1918
            );
1919
      } else {
1920
        $extract = $replacerForSkippedText . \trim(
1921
                UTF8::substr(
1922
                    $text,
1923
                    $pos_start,
1924
                    $pos_end,
1925
                    $this->encoding
1926
                ),
1927
                $trimChars
1928
            ) . $replacerForSkippedText;
1929
      }
1930
1931
    } else {
1932
@@ 1945-1952 (lines=8) @@
1942
          UTF8::strpos($text, '.', $l, $this->encoding)
1943
      );
1944
1945
      if ($pos_end) {
1946
        $extract = \rtrim(
1947
                       UTF8::substr($text, 0, $pos_end, $this->encoding),
1948
                       $trimChars
1949
                   ) . $replacerForSkippedText;
1950
      } else {
1951
        $extract = $text;
1952
      }
1953
    }
1954
1955
    return static::create($extract, $this->encoding);