diff --git a/src/Dibi/Drivers/FirebirdDriver.php b/src/Dibi/Drivers/FirebirdDriver.php index 1802fbbe..e1f8c69f 100644 --- a/src/Dibi/Drivers/FirebirdDriver.php +++ b/src/Dibi/Drivers/FirebirdDriver.php @@ -94,7 +94,7 @@ public function query(string $sql): ?Dibi\ResultDriver $res = ibase_query($resource, $sql); if ($res === false) { - if (ibase_errcode() == self::ERROR_EXCEPTION_THROWN) { + if (ibase_errcode() === self::ERROR_EXCEPTION_THROWN) { preg_match('/exception (\d+) (\w+) (.*)/i', ibase_errmsg(), $match); throw new Dibi\ProcedureException($match[3], $match[1], $match[2], $sql); diff --git a/src/Dibi/Drivers/FirebirdResult.php b/src/Dibi/Drivers/FirebirdResult.php index f37c18d4..be998208 100644 --- a/src/Dibi/Drivers/FirebirdResult.php +++ b/src/Dibi/Drivers/FirebirdResult.php @@ -67,7 +67,7 @@ public function fetch(bool $assoc): ?array : @ibase_fetch_row($this->resultSet, IBASE_TEXT); // intentionally @ if (ibase_errcode()) { - if (ibase_errcode() == FirebirdDriver::ERROR_EXCEPTION_THROWN) { + if (ibase_errcode() === FirebirdDriver::ERROR_EXCEPTION_THROWN) { preg_match('/exception (\d+) (\w+) (.*)/is', ibase_errmsg(), $match); throw new Dibi\ProcedureException($match[3], $match[1], $match[2]); diff --git a/src/Dibi/Drivers/SqliteReflector.php b/src/Dibi/Drivers/SqliteReflector.php index 1933a02b..d402b86f 100644 --- a/src/Dibi/Drivers/SqliteReflector.php +++ b/src/Dibi/Drivers/SqliteReflector.php @@ -64,7 +64,7 @@ public function getColumns(string $table): array 'fullname' => "$table.$column", 'nativetype' => strtoupper($type[0]), 'size' => isset($type[1]) ? (int) $type[1] : null, - 'nullable' => $row['notnull'] == '0', + 'nullable' => $row['notnull'] === '0', 'default' => $row['dflt_value'], 'autoincrement' => $row['pk'] && $type[0] === 'INTEGER', 'vendor' => $row, @@ -98,7 +98,7 @@ public function getIndexes(string $table): array $column = $indexes[$index]['columns'][0]; $primary = false; foreach ($columns as $info) { - if ($column == $info['name']) { + if ($column === $info['name']) { $primary = $info['vendor']['pk']; break; } @@ -138,7 +138,7 @@ public function getForeignKeys(string $table): array $keys[$row['id']]['onDelete'] = $row['on_delete']; $keys[$row['id']]['onUpdate'] = $row['on_update']; - if ($keys[$row['id']]['foreign'][0] == null) { + if ($keys[$row['id']]['foreign'][0] === null) { $keys[$row['id']]['foreign'] = null; } } diff --git a/src/Dibi/Translator.php b/src/Dibi/Translator.php index 32f7a0d0..1a7852e0 100644 --- a/src/Dibi/Translator.php +++ b/src/Dibi/Translator.php @@ -627,7 +627,7 @@ private function cb(array $matches): string if ($matches[8]) { // SQL identifier substitution $m = substr($matches[8], 0, -1); $m = $this->connection->getSubstitutes()->$m; - return $matches[9] == '' + return $matches[9] === '' ? $this->formatValue($m, null) : $m . $matches[9]; // value or identifier }