statement = $statement; $this->execute = $execute; } public function __destruct() { rethrow(new Coroutine(($this->execute)([$this->statement, "deallocateAsync"]))); } /** * @return string */ public function getQuery(): string { return $this->statement->query; } /** * @param mixed ...$params * * @return \AsyncInterop\Promise<\Amp\Postgres\Result> * * @throws \Amp\Postgres\FailureException If executing the statement fails. */ public function execute(...$params): Promise { return new Coroutine(($this->execute)([$this->statement, "execAsync"], $params)); } }