Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Inp.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,25 @@ class Inp implements InpInterface

/**
* Start instance
* @param string $value the input value
* @param mixed $value the input value
* @return self
*/
public function __construct(string $value)
public function __construct(mixed $value)
{
$this->value = $value;
$this->length = $this->getLength($value);
$this->dateTime = new DateTime("now");
$this->getStr = new Str($this->value);
if(is_string($value) || is_numeric($value)) {
$this->length = $this->getLength($value);
}
$this->getStr = new Str((string)$this->value);
}

/**
* Start instance
* @param string $value the input value
* @return self
*/
public static function value(string $value): self
public static function value(mixed $value): self
{
return new self($value);
}
Expand Down