protected function profileCall(string $method, string $sql, array $args)
    {
        $trace = new TracedStatement($sql);
        $trace->start();

        $ex     = null;
        $result = null;

        try {
            $result = $this->pdo->{$method}(...$args);
        } catch (PDOException $e) {
            $ex = $e;
        }

        if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) !== PDO::ERRMODE_EXCEPTION && $result === false) {
            $error = $this->pdo->errorInfo();
            $ex    = new PDOException($error[2], $error[0]);
        }

        $trace->end($ex);

        $this->addExecutedStatement($trace);

        if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) === PDO::ERRMODE_EXCEPTION && $ex !== null) {
            throw $ex;
        }

        return $result;
    }
protected function profileCall(string $method, string $sql, array $args)
    {
        $trace = new TracedStatement($sql);
        $trace->start();

        $ex     = null;
        $result = null;

        try {
            $result = $this->pdo->{$method}(...$args);
        } catch (PDOException $e) {
            $ex = $e;
        }

        if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) !== PDO::ERRMODE_EXCEPTION && $result === false) {
            $error = $this->pdo->errorInfo();
            $ex    = new PDOException($error[2], $error[0]);
        }

        $trace->end($ex);

        $this->addExecutedStatement($trace);

        if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) === PDO::ERRMODE_EXCEPTION && $ex !== null) {
            throw $ex;
        }

        return $result;
    }
protected function profileCall ( string $ method , string $ sql , array $ args ) { $ trace = new TracedStatement ( $ sql ) ; $ trace -> start ( ) ; $ ex = null ; $ result = null ; try { $ result = $ this -> pdo -> { $ method } ( ... $ args ) ; } catch ( PDOException $ e ) { $ ex = $ e ; } if ( $ this -> pdo -> getAttribute ( PDO :: ATTR_ERRMODE ) !== PDO :: ERRMODE_EXCEPTION && $ result === false ) { $ error = $ this -> pdo -> errorInfo ( ) ; $ ex = new PDOException ( $ error [ 2 ] , $ error [ 0 ] ) ; } $ trace -> end ( $ ex ) ; $ this -> addExecutedStatement ( $ trace ) ; if ( $ this -> pdo -> getAttribute ( PDO :: ATTR_ERRMODE ) === PDO :: ERRMODE_EXCEPTION && $ ex !== null ) { throw $ ex ; } return $ result ; }
Profiles a call to a PDO method.

@param string $method
@param string $sql
@param array  $args

@return mixed
Profiles a call to a PDO method .