From 742fb984086f4c62826e08053ba3ac239dc94c92 Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Thu, 30 May 2019 14:43:45 -0500 Subject: [PATCH] Add proper types to Doctrine\DBAL\Id namespace. --- lib/Doctrine/DBAL/Id/TableGenerator.php | 12 +++--------- lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php | 5 +---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/Doctrine/DBAL/Id/TableGenerator.php b/lib/Doctrine/DBAL/Id/TableGenerator.php index 466b30fca0f..14811ad05cf 100644 --- a/lib/Doctrine/DBAL/Id/TableGenerator.php +++ b/lib/Doctrine/DBAL/Id/TableGenerator.php @@ -59,15 +59,13 @@ class TableGenerator /** @var string */ private $generatorTableName; - /** @var mixed[][] */ + /** @var array> */ private $sequences = []; /** - * @param string $generatorTableName - * * @throws DBALException */ - public function __construct(Connection $conn, $generatorTableName = 'sequences') + public function __construct(Connection $conn, string $generatorTableName = 'sequences') { $params = $conn->getParams(); if ($params['driver'] === 'pdo_sqlite') { @@ -80,13 +78,9 @@ public function __construct(Connection $conn, $generatorTableName = 'sequences') /** * Generates the next unused value for the given sequence name. * - * @param string $sequenceName - * - * @return int - * * @throws DBALException */ - public function nextValue($sequenceName) + public function nextValue(string $sequenceName) : int { if (isset($this->sequences[$sequenceName])) { $value = $this->sequences[$sequenceName]['value']; diff --git a/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php b/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php index 0ce062a9a5d..54d26f9445b 100644 --- a/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php +++ b/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php @@ -17,10 +17,7 @@ class TableGeneratorSchemaVisitor implements Visitor /** @var string */ private $generatorTableName; - /** - * @param string $generatorTableName - */ - public function __construct($generatorTableName = 'sequences') + public function __construct(string $generatorTableName = 'sequences') { $this->generatorTableName = $generatorTableName; }