Skip to content

Commit e56a526

Browse files
committed
Use array merge and set default appends to empty array.
Fix unit testing.
1 parent 38660f5 commit e56a526

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Engines/BaseEngine.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ abstract class BaseEngine implements DataTableEngineContract
172172
*
173173
* @var array
174174
*/
175-
private $appends;
175+
private $appends = [];
176176

177177
/**
178178
* Setup search keyword.
@@ -683,11 +683,11 @@ abstract public function paging();
683683
*/
684684
public function render($object = false)
685685
{
686-
$output = $this->appends + [
687-
'draw' => (int) $this->request['draw'],
688-
'recordsTotal' => $this->totalRecords,
689-
'recordsFiltered' => $this->filteredRecords,
690-
];
686+
$output = array_merge([
687+
'draw' => (int) $this->request['draw'],
688+
'recordsTotal' => $this->totalRecords,
689+
'recordsFiltered' => $this->filteredRecords,
690+
], $this->appends);
691691

692692
if (isset($this->transformer)) {
693693
$fractal = new Manager();

0 commit comments

Comments
 (0)