Skip to content

Commit

Permalink
Explicitly mark nullable parameters (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Feb 25, 2025
1 parent 0e065ae commit 42ea454
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Enh #299: Convert database types to lower case (@Tigrov)
- Enh #300: Replace `DbArrayHelper::getColumn()` with `array_column()` (@Tigrov)
- New #301: Add `IndexType` class (@Tigrov)
- Bug #305: Explicitly mark nullable parameters (@vjik)

## 1.3.0 March 21, 2024

Expand Down
4 changes: 2 additions & 2 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
final class Connection extends AbstractPdoConnection
{
public function createCommand(string $sql = null, array $params = []): PdoCommandInterface
public function createCommand(?string $sql = null, array $params = []): PdoCommandInterface
{
$command = new Command($this);

Expand Down Expand Up @@ -55,7 +55,7 @@ public function createTransaction(): TransactionInterface
* @throws InvalidCallException
* @throws Throwable
*/
public function getLastInsertID(string $sequenceName = null): string
public function getLastInsertID(?string $sequenceName = null): string
{
if ($sequenceName === null) {
throw new InvalidArgumentException('Oracle not support lastInsertId without sequence name.');
Expand Down
4 changes: 2 additions & 2 deletions src/DDLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public function addForeignKey(
array|string $columns,
string $referenceTable,
array|string $referenceColumns,
string $delete = null,
string $update = null
?string $delete = null,
?string $update = null
): string {
$sql = 'ALTER TABLE ' . $this->quoter->quoteTableName($table)
. ' ADD CONSTRAINT ' . $this->quoter->quoteColumnName($name)
Expand Down
2 changes: 1 addition & 1 deletion src/DMLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected function prepareInsertValues(string $table, array|QueryInterface $colu
return parent::prepareInsertValues($table, $columns, $params);
}

public function resetSequence(string $table, int|string $value = null): string
public function resetSequence(string $table, int|string|null $value = null): string
{
$tableSchema = $this->schema->getTableSchema($table);

Expand Down

0 comments on commit 42ea454

Please sign in to comment.