Skip to content

Commit 24c8874

Browse files
authored
PHP 8.1 Return type support
The return type for lastInsertId() method needs to be compatible with PDO::lastInsertId(). Adding the return type for stiring|false resolves the compatibility issue encountered in PHP 8.1
1 parent 8530c30 commit 24c8874

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

framework/db/schema/mssql/CMssqlSqlsrvPdoAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +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-
public function lastInsertId($sequence=null)
33+
public function lastInsertId($sequence=null): string|false
3434
{
3535
$parts = explode('.', phpversion('pdo_sqlsrv'));
3636
$sqlsrvVer = phpversion('pdo_sqlsrv') ? intval(array_shift($parts)) : 0;

0 commit comments

Comments
 (0)