| @@ 2156-2173 (lines=18) @@ | ||
| 2153 | * |
|
| 2154 | * @return static |
|
| 2155 | */ |
|
| 2156 | public function lineWrap( |
|
| 2157 | int $limit, |
|
| 2158 | string $break = "\n", |
|
| 2159 | bool $add_final_break = true, |
|
| 2160 | string $delimiter = null |
|
| 2161 | ): self { |
|
| 2162 | return static::create( |
|
| 2163 | $this->utf8::wordwrap_per_line( |
|
| 2164 | $this->str, |
|
| 2165 | $limit, |
|
| 2166 | $break, |
|
| 2167 | true, |
|
| 2168 | $add_final_break, |
|
| 2169 | $delimiter |
|
| 2170 | ), |
|
| 2171 | $this->encoding |
|
| 2172 | ); |
|
| 2173 | } |
|
| 2174 | ||
| 2175 | /** |
|
| 2176 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 2192-2209 (lines=18) @@ | ||
| 2189 | * |
|
| 2190 | * @return static |
|
| 2191 | */ |
|
| 2192 | public function lineWrapAfterWord( |
|
| 2193 | int $limit, |
|
| 2194 | string $break = "\n", |
|
| 2195 | bool $add_final_break = true, |
|
| 2196 | string $delimiter = null |
|
| 2197 | ): self { |
|
| 2198 | return static::create( |
|
| 2199 | $this->utf8::wordwrap_per_line( |
|
| 2200 | $this->str, |
|
| 2201 | $limit, |
|
| 2202 | $break, |
|
| 2203 | false, |
|
| 2204 | $add_final_break, |
|
| 2205 | $delimiter |
|
| 2206 | ), |
|
| 2207 | $this->encoding |
|
| 2208 | ); |
|
| 2209 | } |
|
| 2210 | ||
| 2211 | /** |
|
| 2212 | * Splits on newlines and carriage returns, returning an array of Stringy |
|