Movee Formatters to Type factory

Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
davidarendsen 2022-08-16 15:06:32 +00:00
commit 4abd95f303
12 changed files with 40 additions and 68 deletions

View file

@ -9,9 +9,10 @@ use DateTime;
class Type
{
public function __construct($value)
public function __construct($value, $settings = [])
{
$this->value = $value;
$this->settings = $settings;
}
public function __toString(): string
@ -27,7 +28,7 @@ class Type
case 'boolean':
return new BooleanType($this->value);
case 'array':
return new ArrayType($this->value);
return new ArrayType($this->value, $this->settings);
default:
return (string)$this->value;
}