subscribe = $subscribe; $this->listChanged = $listChanged; } /** * Creates an instance from an array. * * @param array{ * subscribe?: bool|null, * listChanged?: bool|null * } $data * @phpstan-param array $data * @return self */ public static function fromArray(array $data): self { return new self( self::asBoolOrNull($data['subscribe'] ?? null), self::asBoolOrNull($data['listChanged'] ?? null) ); } /** * Converts the instance to an array. * * @return array */ public function toArray(): array { $result = []; if ($this->subscribe !== null) { $result['subscribe'] = $this->subscribe; } if ($this->listChanged !== null) { $result['listChanged'] = $this->listChanged; } return $result; } /** * @return bool|null */ public function getSubscribe(): ?bool { return $this->subscribe; } /** * @return bool|null */ public function getListChanged(): ?bool { return $this->listChanged; } }