Skip to content

Commit e2bf6bf

Browse files
committed
Fixed logging
1 parent 536c13a commit e2bf6bf

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/Builder/QueryStatement.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,10 @@ public function execute(array $params = []) {
8282
*/
8383
public function fetchAll($fetchStyle = PDO::FETCH_ASSOC, $fetchArgument = null, array $ctorArgs = []): array {
8484
$result = $this->exceptionHandler(function() use ($fetchStyle, $fetchArgument, $ctorArgs) {
85-
return $this->queryLoggers->logRegion($this->query, function () use ($fetchStyle, $fetchArgument, $ctorArgs) {
86-
if($fetchArgument !== null) {
87-
return $this->statement->fetchAll($fetchStyle, $fetchArgument, ...$ctorArgs);
88-
}
89-
return $this->statement->fetchAll($fetchStyle);
90-
});
85+
if($fetchArgument !== null) {
86+
return $this->statement->fetchAll($fetchStyle, $fetchArgument, ...$ctorArgs);
87+
}
88+
return $this->statement->fetchAll($fetchStyle);
9189
});
9290
if(is_bool($result)) {
9391
return [];
@@ -103,9 +101,7 @@ public function fetchAll($fetchStyle = PDO::FETCH_ASSOC, $fetchArgument = null,
103101
*/
104102
public function fetch($fetchStyle = PDO::FETCH_ASSOC, $cursorOrientation = PDO::FETCH_ORI_NEXT, $cursorOffset = 0) {
105103
return $this->exceptionHandler(function() use ($fetchStyle, $cursorOrientation, $cursorOffset) {
106-
return $this->queryLoggers->logRegion($this->query, function () use ($fetchStyle, $cursorOrientation, $cursorOffset) {
107-
return $this->statement->fetch($fetchStyle, $cursorOrientation, $cursorOffset);
108-
});
104+
return $this->statement->fetch($fetchStyle, $cursorOrientation, $cursorOffset);
109105
});
110106
}
111107

@@ -115,9 +111,7 @@ public function fetch($fetchStyle = PDO::FETCH_ASSOC, $cursorOrientation = PDO::
115111
*/
116112
public function fetchColumn($columnNo = 0) {
117113
return $this->exceptionHandler(function() use ($columnNo) {
118-
return $this->queryLoggers->logRegion($this->query, function () use ($columnNo) {
119-
return $this->statement->fetchColumn($columnNo);
120-
});
114+
return $this->statement->fetchColumn($columnNo);
121115
});
122116
}
123117

0 commit comments

Comments
 (0)