public function on ($method, $statement, $execution_wall_time = null, array $parameters = []) {
        if ($method === 'prepare' || !$this->getAttribute(\Gajus\Doll\PDO::ATTR_LOGGING)) {
            return;
        }

        $statement = trim(preg_replace('/\s+/', ' ', str_replace("\n", ' ', $statement)));
        $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1];

        $this->log[] = [
            'statement' => $statement,
            'parameters' => $parameters,
            'execution_wall_time' => $execution_wall_time,
            'backtrace' => $backtrace
        ];

        if (count($this->log) % 100 === 0) {
            $this->applyProfileData();
        }
    }
public function on ($method, $statement, $execution_wall_time = null, array $parameters = []) {
        if ($method === 'prepare' || !$this->getAttribute(\Gajus\Doll\PDO::ATTR_LOGGING)) {
            return;
        }

        $statement = trim(preg_replace('/\s+/', ' ', str_replace("\n", ' ', $statement)));
        $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1];

        $this->log[] = [
            'statement' => $statement,
            'parameters' => $parameters,
            'execution_wall_time' => $execution_wall_time,
            'backtrace' => $backtrace
        ];

        if (count($this->log) % 100 === 0) {
            $this->applyProfileData();
        }
    }
public function on ( $ method , $ statement , $ execution_wall_time = null , array $ parameters = [ ] ) { if ( $ method === 'prepare' || ! $ this -> getAttribute ( \ Gajus \ Doll \ PDO :: ATTR_LOGGING ) ) { return ; } $ statement = trim ( preg_replace ( '/\s+/' , ' ' , str_replace ( "\n" , ' ' , $ statement ) ) ) ; $ backtrace = debug_backtrace ( \ DEBUG_BACKTRACE_IGNORE_ARGS , 2 ) [ 1 ] ; $ this -> log [ ] = [ 'statement' => $ statement , 'parameters' => $ parameters , 'execution_wall_time' => $ execution_wall_time , 'backtrace' => $ backtrace ] ; if ( count ( $ this -> log ) % 100 === 0 ) { $ this -> applyProfileData ( ) ; } }
This has to be public since it is accessed by the instance of \Gajus\Doll\PDOStatement.

@param string $method Method used to execute the query: exec, prepare/execute, query, including beginTransaction, commit and rollBack.
@param string $statement The query or prepared statement.
@param float $execution_wall_time Statement execution time calculated using microtime.
@param array $parameters The parameters used to execute a prepared statement.
@return null
This has to be public since it is accessed by the instance of \ Gajus \ Doll \ PDOStatement .