fix: Undefined property: CodeIgniter\Database\OCI8\PreparedQuery::$statement

This commit is contained in:
Dyno 2022-10-11 17:13:08 +02:00
parent 63d50b405d
commit 344bc6f925
No known key found for this signature in database
GPG Key ID: 2C9348AA0D6EF676
2 changed files with 9 additions and 4 deletions

View File

@ -266,7 +266,12 @@ parameters:
path: system/Database/MySQLi/Result.php
-
message: "#^Strict comparison using \\=\\=\\= between array<string, int|string|null> and false will always evaluate to false\\.$#"
message: "#^Property CodeIgniter\\\\Database\\\\BasePreparedQuery\\:\\:\\$statement \\(object\\|resource\\) in isset\\(\\) is not nullable\\.$#"
count: 2
path: system/Database/OCI8/PreparedQuery.php
-
message: "#^Strict comparison using \\=\\=\\= between array and false will always evaluate to false\\.$#"
count: 1
path: system/Database/Postgre/Connection.php

View File

@ -68,7 +68,7 @@ class PreparedQuery extends BasePreparedQuery implements PreparedQueryInterface
*/
public function _execute(array $data): bool
{
if (null === $this->statement) {
if (! isset($this->statement)) {
throw new BadMethodCallException('You must call prepare before trying to execute a prepared statement.');
}
@ -104,8 +104,8 @@ class PreparedQuery extends BasePreparedQuery implements PreparedQueryInterface
public function _close(): bool
{
$error = true;
if (null !== $this->statement) {
$error = oci_free_statement($this->statement);
if (isset($this->statement)) {
$error = (bool) oci_free_statement($this->statement);
unset($this->statement);
}