Document actual types

parent 2348831a
......@@ -200,6 +200,8 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
/**
* {@inheritdoc}
*
* @return int
*/
public function errorCode()
{
......@@ -208,6 +210,8 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
/**
* {@inheritdoc}
*
* @return string
*/
public function errorInfo()
{
......
......@@ -401,6 +401,8 @@ class MysqliStatement implements IteratorAggregate, Statement
/**
* {@inheritdoc}
*
* @return string
*/
public function errorInfo()
{
......
......@@ -148,6 +148,8 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
/**
* {@inheritdoc}
*
* @return int|false
*/
public function lastInsertId($name = null)
{
......
......@@ -56,12 +56,15 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
* @param string $prepareString
* @param array<int, int> $driverOptions
*
* @return Statement
* @return \PDOStatement
*/
public function prepare($prepareString, $driverOptions = [])
{
try {
return parent::prepare($prepareString, $driverOptions);
$statement = parent::prepare($prepareString, $driverOptions);
assert($statement instanceof \PDOStatement);
return $statement;
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
......@@ -69,6 +72,8 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
/**
* {@inheritdoc}
*
* @return \PDOStatement
*/
public function query()
{
......
......@@ -108,6 +108,8 @@ class Connection extends \Doctrine\DBAL\Connection
/**
* {@inheritdoc}
*
* @return Statement
*/
public function prepare($statement)
{
......
......@@ -21,7 +21,7 @@ use const CASE_LOWER;
*/
class ResultCacheTest extends DbalFunctionalTestCase
{
/** @var array<int, array<int, int|string>> */
/** @var list<array{test_int: int, test_string: string}> */
private $expectedResult = [['test_int' => 100, 'test_string' => 'foo'], ['test_int' => 200, 'test_string' => 'bar'], ['test_int' => 300, 'test_string' => 'baz']];
/** @var DebugStack */
......
......@@ -7,6 +7,7 @@ use Doctrine\DBAL\Driver\DriverException;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Statement;
use Doctrine\DBAL\Types\Type;
use Doctrine\Tests\DbalFunctionalTestCase;
use Throwable;
......@@ -94,6 +95,7 @@ class WriteTest extends DbalFunctionalTestCase
$sql = 'INSERT INTO write_table (test_int, test_string) VALUES (?, ?)';
$stmt = $this->connection->prepare($sql);
self::assertInstanceOf(Statement::class, $stmt);
$stmt->bindValue(1, 1, Type::getType('integer'));
$stmt->bindValue(2, 'foo', Type::getType('string'));
$stmt->execute();
......@@ -106,6 +108,7 @@ class WriteTest extends DbalFunctionalTestCase
$sql = 'INSERT INTO write_table (test_int, test_string) VALUES (?, ?)';
$stmt = $this->connection->prepare($sql);
self::assertInstanceOf(Statement::class, $stmt);
$stmt->bindValue(1, 1, 'integer');
$stmt->bindValue(2, 'foo', 'string');
$stmt->execute();
......
......@@ -16,7 +16,7 @@ class DbalPerformanceTestListener implements TestListener
{
use TestListenerDefaultImplementation;
/** @var string[][] */
/** @var array<string, array<string, float>> */
private $timings = [];
public function endTest(Test $test, float $time) : void
......
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