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

add #[\ReturnTypeWillChange] on mssql classes #19177

Merged
merged 1 commit into from
Jan 20, 2022
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
2 changes: 2 additions & 0 deletions framework/db/mssql/DBLibPDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DBLibPDO extends \PDO
* @param string|null $name the sequence name. Defaults to null.
* @return int last inserted ID value.
*/
#[\ReturnTypeWillChange]
public function lastInsertId($name = null)
{
return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
Expand All @@ -35,6 +36,7 @@ public function lastInsertId($name = null)
* @return mixed A successful call returns the value of the requested PDO attribute.
* An unsuccessful call returns null.
*/
#[\ReturnTypeWillChange]
public function getAttribute($attribute)
{
try {
Expand Down
5 changes: 5 additions & 0 deletions framework/db/mssql/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class PDO extends \PDO
* @param string|null $sequence the sequence name. Defaults to null.
* @return int last inserted ID value.
*/
#[\ReturnTypeWillChange]
public function lastInsertId($sequence = null)
{
return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
Expand All @@ -31,6 +32,7 @@ public function lastInsertId($sequence = null)
* natively support transactions.
* @return bool the result of a transaction start.
*/
#[\ReturnTypeWillChange]
public function beginTransaction()
{
$this->exec('BEGIN TRANSACTION');
Expand All @@ -43,6 +45,7 @@ public function beginTransaction()
* natively support transactions.
* @return bool the result of a transaction commit.
*/
#[\ReturnTypeWillChange]
public function commit()
{
$this->exec('COMMIT TRANSACTION');
Expand All @@ -55,6 +58,7 @@ public function commit()
* natively support transactions.
* @return bool the result of a transaction roll back.
*/
#[\ReturnTypeWillChange]
public function rollBack()
{
$this->exec('ROLLBACK TRANSACTION');
Expand All @@ -71,6 +75,7 @@ public function rollBack()
* @return mixed A successful call returns the value of the requested PDO attribute.
* An unsuccessful call returns null.
*/
#[\ReturnTypeWillChange]
public function getAttribute($attribute)
{
try {
Expand Down
1 change: 1 addition & 0 deletions framework/db/mssql/SqlsrvPDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SqlsrvPDO extends \PDO
* @param string|null $sequence the sequence name. Defaults to null.
* @return int last inserted ID value.
*/
#[\ReturnTypeWillChange]
public function lastInsertId($sequence = null)
{
return !$sequence ? parent::lastInsertId() : parent::lastInsertId($sequence);
Expand Down