original_string: public function transaction(callable $closure)
      {
          $this->start();
          try {
              $result = $closure();
          } catch (\Throwable $e) {
              $this->rollback();
              throw $e;
          }
          $this->commit();
  
          return $result;
      }
code: public function transaction(callable $closure)
      {
          $this->start();
          try {
              $result = $closure();
          } catch (\Throwable $e) {
              $this->rollback();
              throw $e;
          }
          $this->commit();
  
          return $result;
      }
code_tokens: public function transaction ( callable $ closure ) { $ this -> start ( ) ; try { $ result = $ closure ( ) ; } catch ( \ Throwable $ e ) { $ this -> rollback ( ) ; throw $ e ; } $ this -> commit ( ) ; return $ result ; }
docstring: Run a closure inside a transaction
  
  Begins a transaction before running the closure and commits the
  transaction afterwards. When the closure emits an exception or
  throwable error, the transaction will be rolled back.
  
  @param callable $closure Closure without required parameters
  @return mixed Closure return value
  @throws \Throwable Exceptions thrown by the closure
docstring_tokens: Run a closure inside a transaction