Skip to content

Commit

Permalink
Remove $rawSql parameter from internalExecute() method of `Abstra…
Browse files Browse the repository at this point in the history
…ctCommand` and `AbstractPdoCommand` classes (#841)
  • Loading branch information
Tigrov authored May 9, 2024
1 parent 68823a6 commit 1ff947e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions src/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions src/Driver/Pdo/AbstractPdoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/CommonCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,7 @@ protected function getQueryBuilder(): QueryBuilderInterface
{
}

protected function internalExecute(string|null $rawSql): void
protected function internalExecute(): void
{
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/CommonPdoCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ protected function getQueryBuilder(): QueryBuilderInterface
{
}

protected function internalExecute(?string $rawSql): void
protected function internalExecute(): void
{
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/Stub/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down

0 comments on commit 1ff947e

Please sign in to comment.