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
/** @var string */
private $generatorTableName;
/** @var mixed[][] */
/** @var array<string, array<string, int>> */
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 @@ class TableGenerator
/**
* 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'];
......
......@@ -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;
}
......
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