From 15a9c989ce80dc8e1e54ffc07e0acb2d6dcc39db Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 1 Mar 2021 19:51:41 +0100 Subject: [PATCH] added PHP 8 typehints --- src/Dibi/Bridges/Tracy/Panel.php | 2 +- src/Dibi/Connection.php | 33 +++++++++-------------------- src/Dibi/DataSource.php | 10 ++++----- src/Dibi/DateTime.php | 5 +---- src/Dibi/Drivers/DummyDriver.php | 5 +++-- src/Dibi/Drivers/FirebirdDriver.php | 2 +- src/Dibi/Drivers/FirebirdResult.php | 2 +- src/Dibi/Drivers/MySqliDriver.php | 5 +---- src/Dibi/Drivers/NoDataResult.php | 2 +- src/Dibi/Drivers/OdbcDriver.php | 2 +- src/Dibi/Drivers/OdbcResult.php | 2 +- src/Dibi/Drivers/OracleDriver.php | 2 +- src/Dibi/Drivers/OracleResult.php | 2 +- src/Dibi/Drivers/PostgreDriver.php | 2 +- src/Dibi/Drivers/PostgreResult.php | 2 +- src/Dibi/Drivers/SqlsrvDriver.php | 2 +- src/Dibi/Drivers/SqlsrvResult.php | 2 +- src/Dibi/Event.php | 5 +---- src/Dibi/Fluent.php | 21 +++++++++--------- src/Dibi/Helpers.php | 9 ++++---- src/Dibi/Reflection/Column.php | 6 ++---- src/Dibi/Result.php | 17 +++++++-------- src/Dibi/ResultIterator.php | 6 ++---- src/Dibi/Row.php | 3 +-- src/Dibi/Translator.php | 3 +-- src/Dibi/dibi.php | 5 ++--- src/Dibi/exceptions.php | 11 +++++----- src/Dibi/interfaces.php | 7 ++---- 28 files changed, 71 insertions(+), 104 deletions(-) diff --git a/src/Dibi/Bridges/Tracy/Panel.php b/src/Dibi/Bridges/Tracy/Panel.php index 4ca16efff..5062932f5 100644 --- a/src/Dibi/Bridges/Tracy/Panel.php +++ b/src/Dibi/Bridges/Tracy/Panel.php @@ -32,7 +32,7 @@ class Panel implements Tracy\IBarPanel private array $events = []; - public function __construct($explain = true, int $filter = null) + public function __construct(bool $explain = true, int $filter = null) { $this->filter = $filter ?: Event::QUERY; $this->explain = $explain; diff --git a/src/Dibi/Connection.php b/src/Dibi/Connection.php index d041a2129..070688ce2 100644 --- a/src/Dibi/Connection.php +++ b/src/Dibi/Connection.php @@ -186,9 +186,8 @@ final public function isConnected(): bool /** * Returns configuration variable. If no $key is passed, returns the entire array. * @see self::__construct - * @return mixed */ - final public function getConfig(string $key = null, $default = null) + final public function getConfig(string $key = null, $default = null): mixed { return $key === null ? $this->config @@ -210,10 +209,9 @@ final public function getDriver(): Driver /** * Generates (translates) and executes SQL query. - * @param mixed ...$args * @throws Exception */ - final public function query(...$args): Result + final public function query(mixed ...$args): Result { return $this->nativeQuery($this->translate(...$args)); } @@ -221,10 +219,9 @@ final public function query(...$args): Result /** * Generates SQL query. - * @param mixed ...$args * @throws Exception */ - final public function translate(...$args): string + final public function translate(mixed ...$args): string { if (!$this->driver) { $this->connect(); @@ -235,9 +232,8 @@ final public function translate(...$args): string /** * Generates and prints SQL query. - * @param mixed ...$args */ - final public function test(...$args): bool + final public function test(mixed ...$args): bool { try { Helpers::dump($this->translate(...$args)); @@ -256,10 +252,9 @@ final public function test(...$args): bool /** * Generates (translates) and returns SQL query as DataSource. - * @param mixed ...$args * @throws Exception */ - final public function dataSource(...$args): DataSource + final public function dataSource(mixed ...$args): DataSource { return new DataSource($this->translate(...$args), $this); } @@ -413,10 +408,7 @@ public function rollback(string $savepoint = null): void } - /** - * @return mixed - */ - public function transaction(callable $callback) + public function transaction(callable $callback): mixed { if ($this->transactionDepth === 0) { $this->begin(); @@ -520,10 +512,9 @@ public function substitute(string $value): string /** * Executes SQL query and fetch result - shortcut for query() & fetch(). - * @param mixed ...$args * @throws Exception */ - public function fetch(...$args): ?Row + public function fetch(mixed ...$args): ?Row { return $this->query($args)->fetch(); } @@ -531,11 +522,10 @@ public function fetch(...$args): ?Row /** * Executes SQL query and fetch results - shortcut for query() & fetchAll(). - * @param mixed ...$args * @return Row[]|array[] * @throws Exception */ - public function fetchAll(...$args): array + public function fetchAll(mixed ...$args): array { return $this->query($args)->fetchAll(); } @@ -543,11 +533,9 @@ public function fetchAll(...$args): array /** * Executes SQL query and fetch first column - shortcut for query() & fetchSingle(). - * @param mixed ...$args - * @return mixed * @throws Exception */ - public function fetchSingle(...$args) + public function fetchSingle(mixed ...$args): mixed { return $this->query($args)->fetchSingle(); } @@ -555,10 +543,9 @@ public function fetchSingle(...$args) /** * Executes SQL query and fetch pairs - shortcut for query() & fetchPairs(). - * @param mixed ...$args * @throws Exception */ - public function fetchPairs(...$args): array + public function fetchPairs(mixed ...$args): array { return $this->query($args)->fetchPairs(); } diff --git a/src/Dibi/DataSource.php b/src/Dibi/DataSource.php index f3920e8b9..4dd2497bb 100644 --- a/src/Dibi/DataSource.php +++ b/src/Dibi/DataSource.php @@ -55,7 +55,7 @@ public function __construct(string $sql, Connection $connection) * @param string|array $col column name or array of column names * @param string $as column alias */ - public function select($col, string $as = null): self + public function select(string|array $col, string $as = null): static { if (is_array($col)) { $this->cols = $col; @@ -70,7 +70,7 @@ public function select($col, string $as = null): self /** * Adds conditions to query. */ - public function where($cond): self + public function where($cond): static { $this->conds[] = is_array($cond) ? $cond // TODO: not consistent with select and orderBy @@ -84,7 +84,7 @@ public function where($cond): self * Selects columns to order by. * @param string|array $row column name or array of column names */ - public function orderBy($row, string $direction = 'ASC'): self + public function orderBy(string|array $row, string $direction = 'ASC'): static { if (is_array($row)) { $this->sorting = $row; @@ -99,7 +99,7 @@ public function orderBy($row, string $direction = 'ASC'): self /** * Limits number of rows. */ - public function applyLimit(int $limit, int $offset = null): self + public function applyLimit(int $limit, int $offset = null): static { $this->limit = $limit; $this->offset = $offset; @@ -148,7 +148,7 @@ public function fetch(): ?Row * Like fetch(), but returns only first field. * @return mixed value on success, null if no next record */ - public function fetchSingle() + public function fetchSingle(): mixed { return $this->getResult()->fetchSingle(); } diff --git a/src/Dibi/DateTime.php b/src/Dibi/DateTime.php index c18c1b2cf..cbb897d49 100644 --- a/src/Dibi/DateTime.php +++ b/src/Dibi/DateTime.php @@ -17,10 +17,7 @@ class DateTime extends \DateTimeImmutable { use Strict; - /** - * @param string|int $time - */ - public function __construct($time = 'now', \DateTimeZone $timezone = null) + public function __construct(string|int $time = 'now', \DateTimeZone $timezone = null) { $timezone = $timezone ?: new \DateTimeZone(date_default_timezone_get()); if (is_numeric($time)) { diff --git a/src/Dibi/Drivers/DummyDriver.php b/src/Dibi/Drivers/DummyDriver.php index 523179a46..d83d1fa14 100644 --- a/src/Dibi/Drivers/DummyDriver.php +++ b/src/Dibi/Drivers/DummyDriver.php @@ -57,7 +57,7 @@ public function rollback(string $savepoint = null): void } - public function getResource() + public function getResource(): mixed { return null; } @@ -171,8 +171,9 @@ public function free(): void } - public function getResultResource() + public function getResultResource(): mixed { + return null; } diff --git a/src/Dibi/Drivers/FirebirdDriver.php b/src/Dibi/Drivers/FirebirdDriver.php index b91d03aca..efe78b994 100644 --- a/src/Dibi/Drivers/FirebirdDriver.php +++ b/src/Dibi/Drivers/FirebirdDriver.php @@ -189,7 +189,7 @@ public function inTransaction(): bool * Returns the connection resource. * @return resource|null */ - public function getResource() + public function getResource(): mixed { return is_resource($this->connection) ? $this->connection : null; } diff --git a/src/Dibi/Drivers/FirebirdResult.php b/src/Dibi/Drivers/FirebirdResult.php index 8a07778c9..979960be0 100644 --- a/src/Dibi/Drivers/FirebirdResult.php +++ b/src/Dibi/Drivers/FirebirdResult.php @@ -102,7 +102,7 @@ public function free(): void * Returns the result set resource. * @return resource|null */ - public function getResultResource() + public function getResultResource(): mixed { $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; diff --git a/src/Dibi/Drivers/MySqliDriver.php b/src/Dibi/Drivers/MySqliDriver.php index 11337314e..e3cf83250 100644 --- a/src/Dibi/Drivers/MySqliDriver.php +++ b/src/Dibi/Drivers/MySqliDriver.php @@ -156,10 +156,7 @@ public function query(string $sql): ?Dibi\ResultDriver } - /** - * @param int|string $code - */ - public static function createException(string $message, $code, string $sql): Dibi\DriverException + public static function createException(string $message, int|string $code, string $sql): Dibi\DriverException { if (in_array($code, [1216, 1217, 1451, 1452, 1701], true)) { return new Dibi\ForeignKeyConstraintViolationException($message, $code, $sql); diff --git a/src/Dibi/Drivers/NoDataResult.php b/src/Dibi/Drivers/NoDataResult.php index 82c309222..932398c8e 100644 --- a/src/Dibi/Drivers/NoDataResult.php +++ b/src/Dibi/Drivers/NoDataResult.php @@ -60,7 +60,7 @@ public function getResultColumns(): array } - public function getResultResource() + public function getResultResource(): mixed { return null; } diff --git a/src/Dibi/Drivers/OdbcDriver.php b/src/Dibi/Drivers/OdbcDriver.php index 9a998e955..4f5064f5f 100644 --- a/src/Dibi/Drivers/OdbcDriver.php +++ b/src/Dibi/Drivers/OdbcDriver.php @@ -167,7 +167,7 @@ public function inTransaction(): bool * Returns the connection resource. * @return resource|null */ - public function getResource() + public function getResource(): mixed { return is_resource($this->connection) ? $this->connection : null; } diff --git a/src/Dibi/Drivers/OdbcResult.php b/src/Dibi/Drivers/OdbcResult.php index 324d84b76..3aa5a79fc 100644 --- a/src/Dibi/Drivers/OdbcResult.php +++ b/src/Dibi/Drivers/OdbcResult.php @@ -122,7 +122,7 @@ public function getResultColumns(): array * Returns the result set resource. * @return resource|null */ - public function getResultResource() + public function getResultResource(): mixed { $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; diff --git a/src/Dibi/Drivers/OracleDriver.php b/src/Dibi/Drivers/OracleDriver.php index 70cb5424f..5fb2a2987 100644 --- a/src/Dibi/Drivers/OracleDriver.php +++ b/src/Dibi/Drivers/OracleDriver.php @@ -183,7 +183,7 @@ public function rollback(string $savepoint = null): void * Returns the connection resource. * @return resource|null */ - public function getResource() + public function getResource(): mixed { return is_resource($this->connection) ? $this->connection : null; } diff --git a/src/Dibi/Drivers/OracleResult.php b/src/Dibi/Drivers/OracleResult.php index bcff77993..e45637565 100644 --- a/src/Dibi/Drivers/OracleResult.php +++ b/src/Dibi/Drivers/OracleResult.php @@ -107,7 +107,7 @@ public function getResultColumns(): array * Returns the result set resource. * @return resource|null */ - public function getResultResource() + public function getResultResource(): mixed { $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; diff --git a/src/Dibi/Drivers/PostgreDriver.php b/src/Dibi/Drivers/PostgreDriver.php index dd1f2a2c8..6ec04aa14 100644 --- a/src/Dibi/Drivers/PostgreDriver.php +++ b/src/Dibi/Drivers/PostgreDriver.php @@ -224,7 +224,7 @@ public function inTransaction(): bool * Returns the connection resource. * @return resource|null */ - public function getResource() + public function getResource(): mixed { return is_resource($this->connection) ? $this->connection : null; } diff --git a/src/Dibi/Drivers/PostgreResult.php b/src/Dibi/Drivers/PostgreResult.php index db159e612..f6c23016d 100644 --- a/src/Dibi/Drivers/PostgreResult.php +++ b/src/Dibi/Drivers/PostgreResult.php @@ -109,7 +109,7 @@ public function getResultColumns(): array * Returns the result set resource. * @return resource|null */ - public function getResultResource() + public function getResultResource(): mixed { $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; diff --git a/src/Dibi/Drivers/SqlsrvDriver.php b/src/Dibi/Drivers/SqlsrvDriver.php index d5fe653f5..7619232f0 100644 --- a/src/Dibi/Drivers/SqlsrvDriver.php +++ b/src/Dibi/Drivers/SqlsrvDriver.php @@ -163,7 +163,7 @@ public function rollback(string $savepoint = null): void * Returns the connection resource. * @return resource|null */ - public function getResource() + public function getResource(): mixed { return is_resource($this->connection) ? $this->connection : null; } diff --git a/src/Dibi/Drivers/SqlsrvResult.php b/src/Dibi/Drivers/SqlsrvResult.php index 21b4b523e..819a9d75b 100644 --- a/src/Dibi/Drivers/SqlsrvResult.php +++ b/src/Dibi/Drivers/SqlsrvResult.php @@ -103,7 +103,7 @@ public function getResultColumns(): array * Returns the result set resource. * @return resource|null */ - public function getResultResource() + public function getResultResource(): mixed { $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; diff --git a/src/Dibi/Event.php b/src/Dibi/Event.php index c3b9de089..5e4bdf1f3 100644 --- a/src/Dibi/Event.php +++ b/src/Dibi/Event.php @@ -75,10 +75,7 @@ public function __construct(Connection $connection, int $type, string $sql = nul } - /** - * @param Result|DriverException|null $result - */ - public function done($result = null): self + public function done(Result|DriverException $result = null): static { $this->result = $result; try { diff --git a/src/Dibi/Fluent.php b/src/Dibi/Fluent.php index cfb2113f8..7f955789b 100644 --- a/src/Dibi/Fluent.php +++ b/src/Dibi/Fluent.php @@ -120,7 +120,7 @@ public function __construct(Connection $connection) /** * Appends new argument to the clause. */ - public function __call(string $clause, array $args): self + public function __call(string $clause, array $args): static { $clause = self::$normalizer->$clause; @@ -206,7 +206,7 @@ public function __call(string $clause, array $args): self /** * Switch to a clause. */ - public function clause(string $clause): self + public function clause(string $clause): static { $this->cursor = &$this->clauses[self::$normalizer->$clause]; if ($this->cursor === null) { @@ -220,7 +220,7 @@ public function clause(string $clause): self /** * Removes a clause. */ - public function removeClause(string $clause): self + public function removeClause(string $clause): static { $this->clauses[self::$normalizer->$clause] = null; return $this; @@ -230,7 +230,7 @@ public function removeClause(string $clause): self /** * Change a SQL flag. */ - public function setFlag(string $flag, bool $value = true): self + public function setFlag(string $flag, bool $value = true): static { $flag = strtoupper($flag); if ($value) { @@ -269,7 +269,7 @@ final public function getConnection(): Connection /** * Adds Result setup. */ - public function setupResult(string $method): self + public function setupResult(string $method): static { $this->setups[] = func_get_args(); return $this; @@ -281,10 +281,10 @@ public function setupResult(string $method): self /** * Generates and executes SQL query. - * @return Result|int|null result set or number of affected rows + * Returns result set or number of affected rows * @throws Exception */ - public function execute(string $return = null) + public function execute(string $return = null): Result|int|null { $res = $this->query($this->_export()); switch ($return) { @@ -300,9 +300,8 @@ public function execute(string $return = null) /** * Generates, executes SQL query and fetches the single row. - * @return Row|array|null */ - public function fetch() + public function fetch(): Row|array|null { return $this->command === 'SELECT' && !$this->clauses['LIMIT'] ? $this->query($this->_export(null, ['%lmt', 1]))->fetch() @@ -312,9 +311,9 @@ public function fetch() /** * Like fetch(), but returns only first field. - * @return mixed value on success, null if no next record + * Returns value on success, null if no next record */ - public function fetchSingle() + public function fetchSingle(): mixed { return $this->command === 'SELECT' && !$this->clauses['LIMIT'] ? $this->query($this->_export(null, ['%lmt', 1]))->fetchSingle() diff --git a/src/Dibi/Helpers.php b/src/Dibi/Helpers.php index e208309ec..3c99ac3af 100644 --- a/src/Dibi/Helpers.php +++ b/src/Dibi/Helpers.php @@ -19,9 +19,8 @@ class Helpers /** * Prints out a syntax highlighted version of the SQL command or Result. - * @param string|Result $sql */ - public static function dump($sql = null, bool $return = false): ?string + public static function dump(string|Result $sql = null, bool $return = false): ?string { ob_start(); if ($sql instanceof Result && PHP_SAPI === 'cli') { @@ -229,7 +228,7 @@ public static function alias(array &$config, string $key, string $alias): void /** * Import SQL dump from file. - * @return int count of sql commands + * Returns count of sql commands */ public static function loadFromFile(Connection $connection, string $file, callable $onProgress = null): int { @@ -277,14 +276,14 @@ public static function loadFromFile(Connection $connection, string $file, callab /** @internal */ - public static function false2Null($val) + public static function false2Null(mixed $val): mixed { return $val === false ? null : $val; } /** @internal */ - public static function intVal($value): int + public static function intVal(mixed $value): int { if (is_int($value)) { return $value; diff --git a/src/Dibi/Reflection/Column.php b/src/Dibi/Reflection/Column.php index 0019c2b1d..fb52b68fa 100644 --- a/src/Dibi/Reflection/Column.php +++ b/src/Dibi/Reflection/Column.php @@ -108,15 +108,13 @@ public function isAutoIncrement(): bool } - /** @return mixed */ - public function getDefault() + public function getDefault(): mixed { return $this->info['default'] ?? null; } - /** @return mixed */ - public function getVendorInfo(string $key) + public function getVendorInfo(string $key): mixed { return $this->info['vendor'][$key] ?? null; } diff --git a/src/Dibi/Result.php b/src/Dibi/Result.php index 41cecc1e4..29d365abf 100644 --- a/src/Dibi/Result.php +++ b/src/Dibi/Result.php @@ -130,7 +130,7 @@ final public function getColumnCount(): int /** * Set fetched object class. This class should extend the Row class. */ - public function setRowClass(?string $class): self + public function setRowClass(?string $class): static { $this->rowClass = $class; return $this; @@ -149,7 +149,7 @@ public function getRowClass(): ?string /** * Set a factory to create fetched object instances. These should extend the Row class. */ - public function setRowFactory(callable $callback): self + public function setRowFactory(callable $callback): static { $this->rowFactory = $callback; return $this; @@ -159,9 +159,8 @@ public function setRowFactory(callable $callback): self /** * Fetches the row at current position, process optional type conversion. * and moves the internal cursor to the next position - * @return Row|array|null */ - final public function fetch() + final public function fetch(): Row|array|null { $row = $this->getResultDriver()->fetch(true); if ($row === null) { @@ -180,9 +179,9 @@ final public function fetch() /** * Like fetch(), but returns only first field. - * @return mixed value on success, null if no next record + * Returns value on success, null if no next record */ - final public function fetchSingle() + final public function fetchSingle(): mixed { $row = $this->getResultDriver()->fetch(true); if ($row === null) { @@ -522,7 +521,7 @@ private function normalize(array &$row): void * Define column type. * @param string|null $type use constant Type::* */ - final public function setType(string $column, ?string $type): self + final public function setType(string $column, ?string $type): static { $this->types[$column] = $type; return $this; @@ -550,7 +549,7 @@ final public function getTypes(): array /** * Sets type format. */ - final public function setFormat(string $type, ?string $format): self + final public function setFormat(string $type, ?string $format): static { $this->formats[$type] = $format; return $this; @@ -560,7 +559,7 @@ final public function setFormat(string $type, ?string $format): self /** * Sets type formats. */ - final public function setFormats(array $formats): self + final public function setFormats(array $formats): static { $this->formats = $formats; return $this; diff --git a/src/Dibi/ResultIterator.php b/src/Dibi/ResultIterator.php index 3c23e6c3a..2f3f5c763 100644 --- a/src/Dibi/ResultIterator.php +++ b/src/Dibi/ResultIterator.php @@ -43,9 +43,8 @@ public function rewind(): void /** * Returns the key of the current element. - * @return mixed */ - public function key() + public function key(): mixed { return $this->pointer; } @@ -53,9 +52,8 @@ public function key() /** * Returns the current element. - * @return mixed */ - public function current() + public function current(): mixed { return $this->row; } diff --git a/src/Dibi/Row.php b/src/Dibi/Row.php index f367fd456..b4676aadb 100644 --- a/src/Dibi/Row.php +++ b/src/Dibi/Row.php @@ -31,9 +31,8 @@ public function toArray(): array /** * Converts value to DateTime object. - * @return DateTime|string|null */ - public function asDateTime(string $key, string $format = null) + public function asDateTime(string $key, string $format = null): DateTime|string|null { $time = $this[$key]; if (!$time instanceof DateTime) { diff --git a/src/Dibi/Translator.php b/src/Dibi/Translator.php index 097354822..b28229888 100644 --- a/src/Dibi/Translator.php +++ b/src/Dibi/Translator.php @@ -159,9 +159,8 @@ public function translate(array $args): string /** * Apply modifier to single value. - * @param mixed $value */ - public function formatValue($value, ?string $modifier): string + public function formatValue(mixed $value, ?string $modifier): string { if ($this->comment) { return '...'; diff --git a/src/Dibi/dibi.php b/src/Dibi/dibi.php index cad0c815b..80380ebbf 100644 --- a/src/Dibi/dibi.php +++ b/src/Dibi/dibi.php @@ -88,7 +88,7 @@ final public function __construct() * @param array $config connection parameters * @throws Dibi\Exception */ - public static function connect($config = [], string $name = '0'): Dibi\Connection + public static function connect(array $config = [], string $name = '0'): Dibi\Connection { return self::$connection = self::$registry[$name] = new Dibi\Connection($config, $name); } @@ -151,10 +151,9 @@ public static function __callStatic(string $name, array $args) /** * Prints out a syntax highlighted version of the SQL command or Result. - * @param string|Dibi\Result $sql * @param bool $return return output instead of printing it? */ - public static function dump($sql = null, bool $return = false): ?string + public static function dump(string|Dibi\Result $sql = null, bool $return = false): ?string { return Dibi\Helpers::dump($sql, $return); } diff --git a/src/Dibi/exceptions.php b/src/Dibi/exceptions.php index 48b78c022..e6312f01b 100644 --- a/src/Dibi/exceptions.php +++ b/src/Dibi/exceptions.php @@ -18,11 +18,12 @@ class Exception extends \Exception private ?string $sql; - /** - * @param int|string $code - */ - public function __construct(string $message = '', $code = 0, string $sql = null, \Throwable $previous = null) - { + public function __construct( + string $message = '', + int|string $code = 0, + string $sql = null, + \Throwable $previous = null, + ) { parent::__construct($message, 0, $previous); $this->code = $code; $this->sql = $sql; diff --git a/src/Dibi/interfaces.php b/src/Dibi/interfaces.php index 9f6b21223..bb0db7e21 100644 --- a/src/Dibi/interfaces.php +++ b/src/Dibi/interfaces.php @@ -67,9 +67,8 @@ function rollback(string $savepoint = null): void; /** * Returns the connection resource. - * @return mixed */ - function getResource(); + function getResource(): mixed; /** * Returns the connection reflector. @@ -117,7 +116,6 @@ function getRowCount(): int; /** * Moves cursor position without fetching row. - * @return bool true on success, false if unable to seek to specified record * @throws Exception */ function seek(int $row): bool; @@ -142,9 +140,8 @@ function getResultColumns(): array; /** * Returns the result set resource. - * @return mixed */ - function getResultResource(); + function getResultResource(): mixed; /** * Decodes data from result set.