From 1ff947e638424592ab0180d25173f66cd8084077 Mon Sep 17 00:00:00 2001 From: Sergei Tigrov Date: Thu, 9 May 2024 18:00:37 +0700 Subject: [PATCH] Remove `$rawSql` parameter from `internalExecute()` method of `AbstractCommand` and `AbstractPdoCommand` classes (#841) --- CHANGELOG.md | 2 ++ UPGRADE.md | 2 ++ src/Command/AbstractCommand.php | 6 ++---- src/Driver/Pdo/AbstractPdoCommand.php | 6 ++---- tests/Common/CommonCommandTest.php | 2 +- tests/Common/CommonPdoCommandTest.php | 2 +- tests/Support/Stub/Command.php | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3092a1ed0..4a4f7ba0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ - Chg #839: Remove `TableSchemaInterface::compositeForeignKey()` method (@Tigrov) - Chg #840: Remove parameter `$withColumn` from `QuoterInterface::getTableNameParts()` method (@Tigrov) - Chg #840: Remove `Quoter::unquoteParts()` method (@Tigrov) +- Chg #841: Remove `$rawSql` parameter from `AbstractCommand::internalExecute()` method + and `AbstractPdoCommand::internalExecute()` method (@Tigrov) ## 1.3.0 March 21, 2024 diff --git a/UPGRADE.md b/UPGRADE.md index 74a87e527..571d45eb5 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -70,6 +70,8 @@ $db->createCommand()->insertBatch('user', $values)->execute(); - `$table` from `AbstractDMLQueryBuilder::normalizeColumnNames()` method - `$table` from `AbstractDMLQueryBuilder::getNormalizeColumnNames()` method - `$withColumn` from `QuoterInterface::getTableNameParts()` method +- `$rawSql` from `AbstractCommand::internalExecute()` method +- `$rawSql` from `AbstractPdoCommand::internalExecute()` method ### Remove deprecated constants diff --git a/src/Command/AbstractCommand.php b/src/Command/AbstractCommand.php index c9f1e505f..ca320ea4e 100644 --- a/src/Command/AbstractCommand.php +++ b/src/Command/AbstractCommand.php @@ -556,12 +556,10 @@ abstract protected function internalGetQueryResult(int $queryMode): mixed; /** * Executes a prepared statement. * - * @param string|null $rawSql Deprecated. Use `null` value. Will be removed in version 2.0.0. - * * @throws Exception * @throws Throwable */ - abstract protected function internalExecute(string|null $rawSql): void; + abstract protected function internalExecute(): void; /** * Check if the value has a given flag. @@ -589,7 +587,7 @@ protected function queryInternal(int $queryMode): mixed $isReadMode = $this->isReadMode($queryMode); $this->prepare($isReadMode); - $this->internalExecute(null); + $this->internalExecute(); /** @psalm-var mixed $result */ $result = $this->internalGetQueryResult($queryMode); diff --git a/src/Driver/Pdo/AbstractPdoCommand.php b/src/Driver/Pdo/AbstractPdoCommand.php index 54899e993..eab69ea87 100644 --- a/src/Driver/Pdo/AbstractPdoCommand.php +++ b/src/Driver/Pdo/AbstractPdoCommand.php @@ -185,12 +185,10 @@ protected function getQueryMode(int $queryMode): string * * It's a wrapper around {@see PDOStatement::execute()} to support transactions and retry handlers. * - * @param string|null $rawSql Deprecated. Use `null` value. Will be removed in version 2.0.0. - * * @throws Exception * @throws Throwable */ - protected function internalExecute(string|null $rawSql): void + protected function internalExecute(): void { $attempt = 0; @@ -202,7 +200,7 @@ protected function internalExecute(string|null $rawSql): void && $this->db->getTransaction() === null ) { $this->db->transaction( - fn () => $this->internalExecute($rawSql), + fn () => $this->internalExecute(), $this->isolationLevel ); } else { diff --git a/tests/Common/CommonCommandTest.php b/tests/Common/CommonCommandTest.php index d08556014..2c8d7d31b 100644 --- a/tests/Common/CommonCommandTest.php +++ b/tests/Common/CommonCommandTest.php @@ -1973,7 +1973,7 @@ protected function getQueryBuilder(): QueryBuilderInterface { } - protected function internalExecute(string|null $rawSql): void + protected function internalExecute(): void { } }; diff --git a/tests/Common/CommonPdoCommandTest.php b/tests/Common/CommonPdoCommandTest.php index 1b00e39b2..98f90aa74 100644 --- a/tests/Common/CommonPdoCommandTest.php +++ b/tests/Common/CommonPdoCommandTest.php @@ -218,7 +218,7 @@ protected function getQueryBuilder(): QueryBuilderInterface { } - protected function internalExecute(?string $rawSql): void + protected function internalExecute(): void { } }; diff --git a/tests/Support/Stub/Command.php b/tests/Support/Stub/Command.php index 3293265c3..027ecb097 100644 --- a/tests/Support/Stub/Command.php +++ b/tests/Support/Stub/Command.php @@ -25,7 +25,7 @@ protected function getQueryBuilder(): QueryBuilderInterface return $this->db->getQueryBuilder(); } - protected function internalExecute(string|null $rawSql): void + protected function internalExecute(): void { throw new NotSupportedException(__METHOD__ . ' is not supported by this DBMS.'); }