Skip to content

Commit c234cd6

Browse files
committed
fix: Undefined property: CodeIgniter\Database\OCI8\PreparedQuery::$statement
1 parent 3bd2a24 commit c234cd6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

phpstan-baseline.neon.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ parameters:
265265
count: 1
266266
path: system/Database/MySQLi/Result.php
267267

268+
-
269+
message: "#^Property CodeIgniter\\\\Database\\\\BasePreparedQuery\\:\\:\\$statement \\(object\\|resource\\) in isset\\(\\) is not nullable\\.$#"
270+
count: 2
271+
path: system/Database/OCI8/PreparedQuery.php
272+
268273
-
269274
message: "#^Strict comparison using \\=\\=\\= between array and false will always evaluate to false\\.$#"
270275
count: 1

system/Database/OCI8/PreparedQuery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function _prepare(string $sql, array $options = [])
6868
*/
6969
public function _execute(array $data): bool
7070
{
71-
if (null === $this->statement) {
71+
if (! isset($this->statement)) {
7272
throw new BadMethodCallException('You must call prepare before trying to execute a prepared statement.');
7373
}
7474

@@ -104,8 +104,8 @@ public function _getResult()
104104
public function _close(): bool
105105
{
106106
$error = true;
107-
if (null !== $this->statement) {
108-
$error = oci_free_statement($this->statement);
107+
if (isset($this->statement)) {
108+
$error = (bool) oci_free_statement($this->statement);
109109
unset($this->statement);
110110
}
111111

0 commit comments

Comments
 (0)