diff --git a/src/Language.php b/src/Language.php index 12c21bb..fb7c9a6 100644 --- a/src/Language.php +++ b/src/Language.php @@ -36,6 +36,12 @@ public function __construct(string $name, string $code, ?bool $supportsFormality $this->supportsFormality = $supportsFormality; } + public static function __set_state(array $array) + { + $object = new Language($array['name'], $array['code'], $array['supportsFormality']); + return $object; + } + public function __toString(): string { return "$this->name ($this->code)";