Code Duplication    Length = 8-11 lines in 2 locations

src/Stringy.php 2 locations

@@ 1914-1924 (lines=11) @@
1911
                ),
1912
                $trimChars
1913
            );
1914
      } else {
1915
        $extract = $replacerForSkippedText . \trim(
1916
                UTF8::substr(
1917
                    $text,
1918
                    $pos_start,
1919
                    $pos_end,
1920
                    $this->encoding
1921
                ),
1922
                $trimChars
1923
            ) . $replacerForSkippedText;
1924
      }
1925
1926
    } else {
1927
@@ 1940-1947 (lines=8) @@
1937
          UTF8::strpos($text, '.', $l, $this->encoding)
1938
      );
1939
1940
      if ($pos_end) {
1941
        $extract = \rtrim(
1942
                       UTF8::substr($text, 0, $pos_end, $this->encoding),
1943
                       $trimChars
1944
                   ) . $replacerForSkippedText;
1945
      } else {
1946
        $extract = $text;
1947
      }
1948
    }
1949
1950
    return static::create($extract, $this->encoding);