src/Channel/Channel.php
public function transaction(\Closure $closure)
    {
        if (!$this->isInitialized()) {
            $this->initialize();
        }

        try {
            $this->startTransaction();

            $result = $closure($this);

            if (!$result) {
                return $this->rollbackTransaction();
            }

            return $this->commitTransaction();
        } catch (\Exception $e) {
            $this->rollbackTransaction();
            throw new HectorException('Transaction failed', 255, $e);
        }
    }
public function transaction(\Closure $closure)
    {
        if (!$this->isInitialized()) {
            $this->initialize();
        }

        try {
            $this->startTransaction();

            $result = $closure($this);

            if (!$result) {
                return $this->rollbackTransaction();
            }

            return $this->commitTransaction();
        } catch (\Exception $e) {
            $this->rollbackTransaction();
            throw new HectorException('Transaction failed', 255, $e);
        }
    }
@param \Closure $closure

@throws \Exception

@return bool