Skip to content

Commit

Permalink
Use array merge and set default appends to empty array.
Browse files Browse the repository at this point in the history
Fix unit testing.
  • Loading branch information
yajra committed Dec 18, 2015
1 parent 38660f5 commit e56a526
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Engines/BaseEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ abstract class BaseEngine implements DataTableEngineContract
*
* @var array
*/
private $appends;
private $appends = [];

/**
* Setup search keyword.
Expand Down Expand Up @@ -683,11 +683,11 @@ abstract public function paging();
*/
public function render($object = false)
{
$output = $this->appends + [
'draw' => (int) $this->request['draw'],
'recordsTotal' => $this->totalRecords,
'recordsFiltered' => $this->filteredRecords,
];
$output = array_merge([
'draw' => (int) $this->request['draw'],
'recordsTotal' => $this->totalRecords,
'recordsFiltered' => $this->filteredRecords,
], $this->appends);

if (isset($this->transformer)) {
$fractal = new Manager();
Expand Down

0 comments on commit e56a526

Please sign in to comment.