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