Assert that the value fetched from the database is always an integer

parent d267775e
...@@ -10,6 +10,8 @@ use Doctrine\DBAL\LockMode; ...@@ -10,6 +10,8 @@ use Doctrine\DBAL\LockMode;
use Throwable; use Throwable;
use const CASE_LOWER; use const CASE_LOWER;
use function array_change_key_case; use function array_change_key_case;
use function assert;
use function is_int;
/** /**
* Table ID Generator for those poor languages that are missing sequences. * Table ID Generator for those poor languages that are missing sequences.
...@@ -111,6 +113,8 @@ class TableGenerator ...@@ -111,6 +113,8 @@ class TableGenerator
$value = $row['sequence_value']; $value = $row['sequence_value'];
$value++; $value++;
assert(is_int($value));
if ($row['sequence_increment_by'] > 1) { if ($row['sequence_increment_by'] > 1) {
$this->sequences[$sequenceName] = [ $this->sequences[$sequenceName] = [
'value' => $value, 'value' => $value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment