Unverified Commit 1e2d36b2 authored by Sergei Morozov's avatar Sergei Morozov

Merge pull request #3573 from jwage/id-types

Add proper types to Doctrine\DBAL\Id namespace.
parents 77d3dfa3 d2555b56
...@@ -59,15 +59,13 @@ class TableGenerator ...@@ -59,15 +59,13 @@ class TableGenerator
/** @var string */ /** @var string */
private $generatorTableName; private $generatorTableName;
/** @var mixed[][] */ /** @var array<string, array<string, int>> */
private $sequences = []; private $sequences = [];
/** /**
* @param string $generatorTableName
*
* @throws DBALException * @throws DBALException
*/ */
public function __construct(Connection $conn, $generatorTableName = 'sequences') public function __construct(Connection $conn, string $generatorTableName = 'sequences')
{ {
$params = $conn->getParams(); $params = $conn->getParams();
if ($params['driver'] === 'pdo_sqlite') { if ($params['driver'] === 'pdo_sqlite') {
...@@ -80,13 +78,9 @@ class TableGenerator ...@@ -80,13 +78,9 @@ class TableGenerator
/** /**
* Generates the next unused value for the given sequence name. * Generates the next unused value for the given sequence name.
* *
* @param string $sequenceName
*
* @return int
*
* @throws DBALException * @throws DBALException
*/ */
public function nextValue($sequenceName) public function nextValue(string $sequenceName) : int
{ {
if (isset($this->sequences[$sequenceName])) { if (isset($this->sequences[$sequenceName])) {
$value = $this->sequences[$sequenceName]['value']; $value = $this->sequences[$sequenceName]['value'];
......
...@@ -17,10 +17,7 @@ class TableGeneratorSchemaVisitor implements Visitor ...@@ -17,10 +17,7 @@ class TableGeneratorSchemaVisitor implements Visitor
/** @var string */ /** @var string */
private $generatorTableName; private $generatorTableName;
/** public function __construct(string $generatorTableName = 'sequences')
* @param string $generatorTableName
*/
public function __construct($generatorTableName = 'sequences')
{ {
$this->generatorTableName = $generatorTableName; $this->generatorTableName = $generatorTableName;
} }
......
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