Skip to content

Commit 3a80860

Browse files
committed
[dbal] use Type::XXX consts.
1 parent 1d9323d commit 3a80860

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎pkg/dbal/DbalConsumer.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected function receiveMessage()
178178

179179
// remove message
180180
$affectedRows = $this->dbal->delete($this->context->getTableName(), ['id' => $dbalMessage['id']], [
181-
'id' => Type::INTEGER,
181+
'id' => Type::BINARY,
182182
]);
183183

184184
if (1 !== $affectedRows) {

‎pkg/dbal/DbalContext.php‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Doctrine\DBAL\Connection;
66
use Doctrine\DBAL\Schema\Table;
7+
use Doctrine\DBAL\Types\Type;
78
use Interop\Queue\InvalidDestinationException;
89
use Interop\Queue\PsrContext;
910
use Interop\Queue\PsrDestination;
@@ -175,19 +176,19 @@ public function createDataBaseTable()
175176
if ($this->getDbalConnection()->getDatabasePlatform()->hasNativeGuidType()) {
176177
$table->addColumn('id', 'guid');
177178
} else {
178-
$table->addColumn('id', 'binary', ['length' => 16]);
179+
$table->addColumn('id', Type::BINARY, ['length' => 16]);
179180
}
180181

181-
$table->addColumn('human_id', 'string', ['length' => 36]);
182-
$table->addColumn('published_at', 'bigint');
183-
$table->addColumn('body', 'text', ['notnull' => false]);
184-
$table->addColumn('headers', 'text', ['notnull' => false]);
185-
$table->addColumn('properties', 'text', ['notnull' => false]);
186-
$table->addColumn('redelivered', 'boolean', ['notnull' => false]);
187-
$table->addColumn('queue', 'string');
188-
$table->addColumn('priority', 'smallint');
189-
$table->addColumn('delayed_until', 'integer', ['notnull' => false]);
190-
$table->addColumn('time_to_live', 'integer', ['notnull' => false]);
182+
$table->addColumn('human_id', Type::STRING, ['length' => 36]);
183+
$table->addColumn('published_at', Type::BIGINT);
184+
$table->addColumn('body', Type::TEXT, ['notnull' => false]);
185+
$table->addColumn('headers', Type::TEXT, ['notnull' => false]);
186+
$table->addColumn('properties', Type::TEXT, ['notnull' => false]);
187+
$table->addColumn('redelivered', Type::BOOLEAN, ['notnull' => false]);
188+
$table->addColumn('queue', Type::STRING);
189+
$table->addColumn('priority', Type::SMALLINT);
190+
$table->addColumn('delayed_until', Type::INTEGER, ['notnull' => false]);
191+
$table->addColumn('time_to_live', Type::INTEGER, ['notnull' => false]);
191192

192193
$table->setPrimaryKey(['id']);
193194
$table->addIndex(['published_at']);

0 commit comments

Comments
 (0)