Skip to content

Commit 9cf9369

Browse files
authored
Merge pull request #4500 from csears123/patch-4
PHP 8.1 deprecation error, add return type for CMssql-classes
2 parents 0cb8b7a + 36e650f commit 9cf9369

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Version 1.1.28 under development
55
--------------------------------
66

77
- Bug #4491: Fixed limit and Offset not working correctly with MSSQL version 11 (2012) and newer (shnoulle, wtommyw)
8+
- Bug #4500: PHP 8.1 compatibility: Fix deprecation warnings in CMysql classes (csears123)
89

910
Version 1.1.27 November 21, 2022
1011
--------------------------------

framework/db/schema/mssql/CMssqlPdoAdapter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class CMssqlPdoAdapter extends PDO
2323
* @param string|null sequence name. Defaults to null
2424
* @return integer last inserted id
2525
*/
26+
#[ReturnTypeWillChange]
2627
public function lastInsertId ($sequence=NULL)
2728
{
2829
return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
@@ -36,6 +37,7 @@ public function lastInsertId ($sequence=NULL)
3637
*
3738
* @return boolean
3839
*/
40+
#[ReturnTypeWillChange]
3941
public function beginTransaction ()
4042
{
4143
$this->exec('BEGIN TRANSACTION');
@@ -50,6 +52,7 @@ public function beginTransaction ()
5052
*
5153
* @return boolean
5254
*/
55+
#[ReturnTypeWillChange]
5356
public function commit ()
5457
{
5558
$this->exec('COMMIT TRANSACTION');
@@ -64,6 +67,7 @@ public function commit ()
6467
*
6568
* @return boolean
6669
*/
70+
#[ReturnTypeWillChange]
6771
public function rollBack ()
6872
{
6973
$this->exec('ROLLBACK TRANSACTION');

framework/db/schema/mssql/CMssqlSqlsrvPdoAdapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class CMssqlSqlsrvPdoAdapter extends PDO
3030
* @param string|null $sequence the sequence/table name. Defaults to null.
3131
* @return integer last inserted ID value.
3232
*/
33+
#[ReturnTypeWillChange]
3334
public function lastInsertId($sequence=null)
3435
{
3536
$parts = explode('.', phpversion('pdo_sqlsrv'));

0 commit comments

Comments
 (0)