Skip to content

Commit

Permalink
Array casting needed
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanThompson committed Jan 31, 2018
1 parent 318f1e4 commit 2d104c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/FilesFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function ids()
$value = $value->pluck('id')->all();
}

return array_filter($value);
return array_filter((array)$value);
}

/**
Expand Down Expand Up @@ -206,7 +206,7 @@ public function valueTable()

// Arrays are from validation.
if (!$files instanceof EntryCollection) {
$table->setUploaded(array_unique($files));
$table->setUploaded(array_unique((array)$files));
}

return $table
Expand Down
2 changes: 1 addition & 1 deletion src/FilesFieldTypeAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function organizeSyncValue(array $value)
/**
* First clean our value.
*/
$value = array_filter(array_unique($value));
$value = array_filter(array_unique((array)$value));

/**
* Next take the natural array
Expand Down

0 comments on commit 2d104c0

Please sign in to comment.