Skip to content

Commit ec146df

Browse files
authored
Merge pull request #5610 from kenjis/fix-SQLSRV/Connection
deprecate Database\SQLSRV\Connection::getError()
2 parents 3989896 + 5998599 commit ec146df

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

system/Database/BaseConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,8 @@ public function isWriteType($sql): bool
15261526
*
15271527
* Must return an array with keys 'code' and 'message':
15281528
*
1529-
* return ['code' => null, 'message' => null);
1529+
* @return array<string, int|string|null>
1530+
* @phpstan-return array{code: int|string|null, message: string|null}
15301531
*/
15311532
abstract public function error(): array;
15321533

system/Database/SQLSRV/Connection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,8 @@ protected function execute(string $sql)
465465
* Returns the last error encountered by this connection.
466466
*
467467
* @return mixed
468+
*
469+
* @deprecated Use `error()` instead.
468470
*/
469471
public function getError()
470472
{

user_guide_src/source/changelogs/v4.2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Changes
3838
Deprecations
3939
************
4040

41-
41+
- ``CodeIgniter\Database\SQLSRV\Connection::getError()`` is deprecated. Use ``CodeIgniter\Database\SQLSRV\Connection::error()`` instead.
4242

4343
Bugs Fixed
4444
**********

0 commit comments

Comments
 (0)