| @@ 1941-1958 (lines=18) @@ | ||
| 1938 | * |
|
| 1939 | * @return static |
|
| 1940 | */ |
|
| 1941 | public function lineWrap( |
|
| 1942 | int $limit, |
|
| 1943 | string $break = "\n", |
|
| 1944 | bool $add_final_break = true, |
|
| 1945 | string $delimiter = null |
|
| 1946 | ): self { |
|
| 1947 | return static::create( |
|
| 1948 | $this->utf8::wordwrap_per_line( |
|
| 1949 | $this->str, |
|
| 1950 | $limit, |
|
| 1951 | $break, |
|
| 1952 | true, |
|
| 1953 | $add_final_break, |
|
| 1954 | $delimiter |
|
| 1955 | ), |
|
| 1956 | $this->encoding |
|
| 1957 | ); |
|
| 1958 | } |
|
| 1959 | ||
| 1960 | /** |
|
| 1961 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 1977-1994 (lines=18) @@ | ||
| 1974 | * |
|
| 1975 | * @return static |
|
| 1976 | */ |
|
| 1977 | public function lineWrapAfterWord( |
|
| 1978 | int $limit, |
|
| 1979 | string $break = "\n", |
|
| 1980 | bool $add_final_break = true, |
|
| 1981 | string $delimiter = null |
|
| 1982 | ): self { |
|
| 1983 | return static::create( |
|
| 1984 | $this->utf8::wordwrap_per_line( |
|
| 1985 | $this->str, |
|
| 1986 | $limit, |
|
| 1987 | $break, |
|
| 1988 | false, |
|
| 1989 | $add_final_break, |
|
| 1990 | $delimiter |
|
| 1991 | ), |
|
| 1992 | $this->encoding |
|
| 1993 | ); |
|
| 1994 | } |
|
| 1995 | ||
| 1996 | /** |
|
| 1997 | * Splits on newlines and carriage returns, returning an array of Stringy |
|