list = $list; $this->cancel = $cancel; } /** * Creates an instance from an array. * * @param array{ * list?: object|null, * cancel?: object|null * } $data * @phpstan-param array $data * @return self */ public static function fromArray(array $data): self { return new self( self::asObjectOrNull($data['list'] ?? null), self::asObjectOrNull($data['cancel'] ?? null) ); } /** * Converts the instance to an array. * * @return array */ public function toArray(): array { $result = []; if ($this->list !== null) { $result['list'] = $this->list; } if ($this->cancel !== null) { $result['cancel'] = $this->cancel; } return $result; } /** * @return object|null */ public function getList(): ?object { return $this->list; } /** * @return object|null */ public function getCancel(): ?object { return $this->cancel; } }