diff --git a/src/Sql/AbstractInsertStatement.php b/src/Sql/AbstractInsertStatement.php index 7d334ff..966e29b 100644 --- a/src/Sql/AbstractInsertStatement.php +++ b/src/Sql/AbstractInsertStatement.php @@ -23,7 +23,7 @@ abstract class AbstractInsertStatement extends AbstractStatement implements Comm * @param string|null $sequence Name of the sequence object from which the ID should be returned. * @return mixed Returns the ID of the last inserted row or sequence value. */ - public function exec(string $sequence = null): mixed + public function exec(?string $sequence = null): mixed { return $this->db()->insert($this->toSql(), $this->getParams(), $sequence); } diff --git a/src/Sql/AbstractStatement.php b/src/Sql/AbstractStatement.php index a1c1aae..15d24c1 100644 --- a/src/Sql/AbstractStatement.php +++ b/src/Sql/AbstractStatement.php @@ -19,7 +19,7 @@ abstract class AbstractStatement implements Statement */ protected bool $built = false; - final public function __construct(StatementExecutor $db = null) + final public function __construct(?StatementExecutor $db = null) { $this->db = $db; } diff --git a/src/StatementExecutor.php b/src/StatementExecutor.php index 4b1f0d4..874553a 100644 --- a/src/StatementExecutor.php +++ b/src/StatementExecutor.php @@ -23,7 +23,7 @@ public function execute(string $sql, array $params): int; * * @return mixed Returns the ID of the last inserted row or sequence value. */ - public function insert(string $sql, array $params, string $sequence = null): mixed; + public function insert(string $sql, array $params, ?string $sequence = null): mixed; /** * Executes the SQL statement and returns all rows.