File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,23 +43,25 @@ class Inp implements InpInterface
4343
4444 /**
4545 * Start instance
46- * @param string $value the input value
46+ * @param mixed $value the input value
4747 * @return self
4848 */
49- public function __construct (string $ value )
49+ public function __construct (mixed $ value )
5050 {
5151 $ this ->value = $ value ;
52- $ this ->length = $ this ->getLength ($ value );
5352 $ this ->dateTime = new DateTime ("now " );
54- $ this ->getStr = new Str ($ this ->value );
53+ if (is_string ($ value ) || is_numeric ($ value )) {
54+ $ this ->length = $ this ->getLength ($ value );
55+ }
56+ $ this ->getStr = new Str ((string )$ this ->value );
5557 }
5658
5759 /**
5860 * Start instance
5961 * @param string $value the input value
6062 * @return self
6163 */
62- public static function value (string $ value ): self
64+ public static function value (mixed $ value ): self
6365 {
6466 return new self ($ value );
6567 }
You can’t perform that action at this time.
0 commit comments