Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix PHPDoc types in Database Connection. #7433

Merged
merged 2 commits into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions system/Database/BaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ abstract protected function _close();
/**
* Create a persistent database connection.
*
* @return mixed
* @return false|object|resource
kenjis marked this conversation as resolved.
Show resolved Hide resolved
* @phpstan-return false|TConnection
*/
public function persistentConnect()
{
Expand Down Expand Up @@ -558,7 +559,7 @@ abstract protected function execute(string $sql);
* Should automatically handle different connections for read/write
* queries if needed.
*
* @param mixed ...$binds
* @param array|string|null $binds
*
* @return BaseResult|bool|Query BaseResult when “read” type query, bool when “write” type query, Query when prepared query
* @phpstan-return BaseResult<TConnection, TResult>|bool|Query
Expand Down Expand Up @@ -1747,7 +1748,7 @@ protected function _enableForeignKeyChecks()
/**
* Accessor for properties if they exist.
*
* @return mixed
* @return array|bool|float|int|object|resource|string|null
*/
public function __get(string $key)
{
Expand Down
8 changes: 4 additions & 4 deletions system/Database/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getConnection(?string $alias = null);
/**
* Select a specific database table to use.
*
* @return mixed
* @return bool
*/
public function setDatabase(string $databaseName);

Expand Down Expand Up @@ -98,7 +98,7 @@ public function getVersion(): string;
* Should automatically handle different connections for read/write
* queries if needed.
*
* @param mixed ...$binds
* @param array|string|null $binds
*
* @return BaseResult|bool|Query
* @phpstan-return BaseResult<TConnection, TResult>|bool|Query
Expand Down Expand Up @@ -127,7 +127,7 @@ public function table($tableName);
/**
* Returns the last query's statement object.
*
* @return mixed
* @return Query
*/
public function getLastQuery();

Expand All @@ -150,7 +150,7 @@ public function escape($str);
*
* @param array ...$params
*
* @return mixed
* @return array|bool|float|int|object|resource|string|null
*/
public function callFunction(string $functionName, ...$params);

Expand Down
2 changes: 1 addition & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ protected function _transRollback(): bool
*
* Overrides BaseConnection::isWriteType, adding additional read query types.
*
* @param mixed $sql
* @param string $sql
*/
public function isWriteType($sql): bool
{
Expand Down
8 changes: 4 additions & 4 deletions system/Database/SQLSRV/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Connection extends BaseConnection
* FALSE or SQLSRV_CURSOR_FORWARD would increase performance,
* but would disable num_rows() (and possibly insert_id())
*
* @var mixed
* @var false|string
*/
public $scrollable;

Expand Down Expand Up @@ -436,7 +436,7 @@ public function affectedRows(): int
/**
* Select a specific database table to use.
*
* @return mixed
* @return bool
*/
public function setDatabase(?string $databaseName = null)
{
Expand Down Expand Up @@ -485,7 +485,7 @@ protected function execute(string $sql)
/**
* Returns the last error encountered by this connection.
*
* @return mixed
* @return array<string, int|string>
*
* @deprecated Use `error()` instead.
*/
Expand Down Expand Up @@ -546,7 +546,7 @@ public function getVersion(): string
*
* Overrides BaseConnection::isWriteType, adding additional read query types.
*
* @param mixed $sql
* @param string $sql
*/
public function isWriteType($sql): bool
{
Expand Down