original_string: public function sql($query, $args = []) {
  		if (!is_string($query) || empty($query))
  			throw new \InvalidArgumentException("Query is not a valid string");
  	
  		//open connection
  		$this->driver->connect();
  			
  		//build statement
  		$stmt = $this->driver->buildStatement($this->typeManager);
  	
  		//build query
  		$query = $stmt->format($query, $args, $this->config);
  		
  		//invoke debug callback
  		if ($this->hasOption('callback.debug')) {
  			$callback = $this->getOption('callback.debug');
  			if ($callback instanceof \Closure)
  				$callback->__invoke($query);
  		}
  		
  		//run query
  		$result = $this->driver->query($query);
  	
  		//check query execution
  		if ($result === false)
  			$this->driver->throwQueryException($stmt);
  	
  		return $result;
  	}
code: public function sql($query, $args = []) {
  		if (!is_string($query) || empty($query))
  			throw new \InvalidArgumentException("Query is not a valid string");
  	
  		//open connection
  		$this->driver->connect();
  			
  		//build statement
  		$stmt = $this->driver->buildStatement($this->typeManager);
  	
  		//build query
  		$query = $stmt->format($query, $args, $this->config);
  		
  		//invoke debug callback
  		if ($this->hasOption('callback.debug')) {
  			$callback = $this->getOption('callback.debug');
  			if ($callback instanceof \Closure)
  				$callback->__invoke($query);
  		}
  		
  		//run query
  		$result = $this->driver->query($query);
  	
  		//check query execution
  		if ($result === false)
  			$this->driver->throwQueryException($stmt);
  	
  		return $result;
  	}
code_tokens: public function sql ( $ query , $ args = [ ] ) { if ( ! is_string ( $ query ) || empty ( $ query ) ) throw new \ InvalidArgumentException ( "Query is not a valid string" ) ; //open connection $ this -> driver -> connect ( ) ; //build statement $ stmt = $ this -> driver -> buildStatement ( $ this -> typeManager ) ; //build query $ query = $ stmt -> format ( $ query , $ args , $ this -> config ) ; //invoke debug callback if ( $ this -> hasOption ( 'callback.debug' ) ) { $ callback = $ this -> getOption ( 'callback.debug' ) ; if ( $ callback instanceof \ Closure ) $ callback -> __invoke ( $ query ) ; } //run query $ result = $ this -> driver -> query ( $ query ) ; //check query execution if ( $ result === false ) $ this -> driver -> throwQueryException ( $ stmt ) ; return $ result ; }
docstring: Runs a query
  @param string $query
  @return mixed
docstring_tokens: Runs a query