Skip to content

Commit f837ccb

Browse files
committed
Change setAlias() default parameter value.
No need to put an if before calling setAlias()
1 parent 6707e12 commit f837ccb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

system/Database/BaseBuilder.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,11 +1789,11 @@ protected function batchExecute(string $renderMethod, int $batchSize = 100)
17891789
* Allows a row or multiple rows to be set for batch inserts/upserts/updates
17901790
*
17911791
* @param array|object $set
1792-
* @param string|null $alias alias for sql table
1792+
* @param string $alias alias for sql table
17931793
*
17941794
* @return $this|null
17951795
*/
1796-
public function setData($set, ?bool $escape = null, ?string $alias = null)
1796+
public function setData($set, ?bool $escape = null, string $alias = '')
17971797
{
17981798
if (empty($set)) {
17991799
if ($this->db->DBDebug) {
@@ -1803,9 +1803,7 @@ public function setData($set, ?bool $escape = null, ?string $alias = null)
18031803
return null; // @codeCoverageIgnore
18041804
}
18051805

1806-
if ($alias !== null) {
1807-
$this->setAlias($alias);
1808-
}
1806+
$this->setAlias($alias);
18091807

18101808
// this allows to set just one row at a time
18111809
if (is_object($set) || (! is_array(current($set)) && ! is_object(current($set)))) {

0 commit comments

Comments
 (0)