| @@ 1955-1972 (lines=18) @@ | ||
| 1952 | * |
|
| 1953 | * @return static |
|
| 1954 | */ |
|
| 1955 | public function lineWrap( |
|
| 1956 | int $limit, |
|
| 1957 | string $break = "\n", |
|
| 1958 | bool $add_final_break = true, |
|
| 1959 | string $delimiter = null |
|
| 1960 | ): self { |
|
| 1961 | return static::create( |
|
| 1962 | $this->utf8::wordwrap_per_line( |
|
| 1963 | $this->str, |
|
| 1964 | $limit, |
|
| 1965 | $break, |
|
| 1966 | true, |
|
| 1967 | $add_final_break, |
|
| 1968 | $delimiter |
|
| 1969 | ), |
|
| 1970 | $this->encoding |
|
| 1971 | ); |
|
| 1972 | } |
|
| 1973 | ||
| 1974 | /** |
|
| 1975 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 1991-2008 (lines=18) @@ | ||
| 1988 | * |
|
| 1989 | * @return static |
|
| 1990 | */ |
|
| 1991 | public function lineWrapAfterWord( |
|
| 1992 | int $limit, |
|
| 1993 | string $break = "\n", |
|
| 1994 | bool $add_final_break = true, |
|
| 1995 | string $delimiter = null |
|
| 1996 | ): self { |
|
| 1997 | return static::create( |
|
| 1998 | $this->utf8::wordwrap_per_line( |
|
| 1999 | $this->str, |
|
| 2000 | $limit, |
|
| 2001 | $break, |
|
| 2002 | false, |
|
| 2003 | $add_final_break, |
|
| 2004 | $delimiter |
|
| 2005 | ), |
|
| 2006 | $this->encoding |
|
| 2007 | ); |
|
| 2008 | } |
|
| 2009 | ||
| 2010 | /** |
|
| 2011 | * Splits on newlines and carriage returns, returning an array of Stringy |
|