Skip to content

Commit 696f4b5

Browse files
author
rkr
committed
- PHP7-Compatibility fix
1 parent a01edce commit 696f4b5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Builder/QueryStatement.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ public function execute(array $params = []) {
5959
*/
6060
public function fetchAll($fetchStyle = PDO::FETCH_ASSOC, $fetchArgument = null, array $ctorArgs = []) {
6161
return $this->exceptionHandler(function() use ($fetchStyle, $fetchArgument, $ctorArgs) {
62-
return $this->statement->fetchAll($fetchStyle, $fetchArgument, $ctorArgs);
62+
if($fetchArgument !== null) {
63+
return $this->statement->fetchAll($fetchStyle, $fetchArgument, $ctorArgs);
64+
}
65+
return $this->statement->fetchAll($fetchStyle);
6366
});
6467
}
6568

tests/Builder/InterceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ public function testQuery() {
1717
$this->assertArrayHasKey('SHOW TABLES', $queries);
1818
$this->assertEquals(1000, $queries['SHOW TABLES']);
1919
}
20-
}
20+
}

0 commit comments

Comments
 (0)