Skip to content

Commit

Permalink
strict comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 2, 2020
1 parent 70d4246 commit 78e207c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Dibi/Drivers/FirebirdDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Drivers/FirebirdResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
6 changes: 3 additions & 3 deletions src/Dibi/Drivers/SqliteReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 78e207c

Please sign in to comment.