data = $package; if ($type) { $this->data->set('package_type', $type); } } /** * @return Data */ public function getData() { return $this->data; } /** * @param string $key * @return mixed */ #[\ReturnTypeWillChange] public function __get($key) { return $this->data->get($key); } /** * @param string $key * @param mixed $value * @return void */ #[\ReturnTypeWillChange] public function __set($key, $value) { $this->data->set($key, $value); } /** * @param string $key * @return bool */ #[\ReturnTypeWillChange] public function __isset($key) { return isset($this->data->{$key}); } /** * @return string */ #[\ReturnTypeWillChange] public function __toString() { return $this->toJson(); } /** * @return string */ public function toJson() { return $this->data->toJson(); } /** * @return array */ public function toArray() { return $this->data->toArray(); } }