src/bbn/db.php
public function parse_query(string $statement): ?array
  {
    if ( $this->parser === null ){
      $this->parser = new \PHPSQLParser\PHPSQLParser();
    }
    try {
      $r = $this->parser->parse($statement);
      if ( !count($r) ){
        return null;
      }
      if ( isset($r['BRACKET']) && (\count($r) === 1) ){
        return null;
      }
      return $r;
    }
    catch ( \Exception $e ){
      $this->log('Impossible to parse the query '.$statement);
    }
    return null;
  }
public function parse_query(string $statement): ?array
  {
    if ( $this->parser === null ){
      $this->parser = new \PHPSQLParser\PHPSQLParser();
    }
    try {
      $r = $this->parser->parse($statement);
      if ( !count($r) ){
        return null;
      }
      if ( isset($r['BRACKET']) && (\count($r) === 1) ){
        return null;
      }
      return $r;
    }
    catch ( \Exception $e ){
      $this->log('Impossible to parse the query '.$statement);
    }
    return null;
  }
public function parse_query ( string $ statement ) : ? array { if ( $ this -> parser === null ) { $ this -> parser = new \ PHPSQLParser \ PHPSQLParser ( ) ; } try { $ r = $ this -> parser -> parse ( $ statement ) ; if ( ! count ( $ r ) ) { return null ; } if ( isset ( $ r [ 'BRACKET' ] ) && ( \ count ( $ r ) === 1 ) ) { return null ; } return $ r ; } catch ( \ Exception $ e ) { $ this -> log ( 'Impossible to parse the query ' . $ statement ) ; } return null ; }
Parses a SQL query and return an array.

@param string $statement
@return null|array
Parses a SQL query and return an array .