@@ -136,11 +136,11 @@ public function trim(string $chars = " \t\n\r\0\x0B"): self
136136 }
137137
138138 /**
139- * @return string
139+ * @return StrValue
140140 */
141- public function trimmed (): string
141+ public function trimmed (): self
142142 {
143- return trim ($ this ->value );
143+ return self :: newTrim ($ this ->value );
144144 }
145145
146146 // ------------------ check ------------------
@@ -207,6 +207,14 @@ public function isOneOf(array $arr): bool
207207
208208 // ------------------ convert ------------------
209209
210+ /**
211+ * @return int
212+ */
213+ public function int (): int
214+ {
215+ return (int )$ this ->value ;
216+ }
217+
210218 /**
211219 * @return int
212220 */
@@ -239,10 +247,26 @@ public function getInts(string $sep = ','): array
239247 return $ this ->toInts ($ sep );
240248 }
241249
250+ /**
251+ * @return bool
252+ */
253+ public function bool (): bool
254+ {
255+ return $ this ->getBool ();
256+ }
257+
242258 /**
243259 * @return bool
244260 */
245261 public function toBool (): bool
262+ {
263+ return $ this ->getBool ();
264+ }
265+
266+ /**
267+ * @return bool
268+ */
269+ public function getBool (): bool
246270 {
247271 return Str::toBool ($ this ->value );
248272 }
@@ -274,11 +298,19 @@ public function getStrings(string $sep = ',', int $limit = 0): array
274298 /**
275299 * @return string
276300 */
277- public function toString (): string
301+ public function value (): string
278302 {
279303 return $ this ->value ;
280304 }
281305
306+ /**
307+ * @return string
308+ */
309+ public function toString (): string
310+ {
311+ return $ this ->getValue ();
312+ }
313+
282314 /**
283315 * @return string
284316 */
0 commit comments