Fixed up array_filter stuff

Closes #1071
This commit is contained in:
Graham Campbell
2015-11-07 17:21:20 +00:00
parent fb7a15aaa7
commit bf88dfced0
4 changed files with 48 additions and 29 deletions
@@ -55,7 +55,7 @@ class UpdateIncidentCommandHandler
}
$incident = $command->incident;
$incident->update($this->filterIncidentData($command));
$incident->update($this->filter($command));
// The incident occurred at a different time.
if ($command->incident_date) {
@@ -86,7 +86,7 @@ class UpdateIncidentCommandHandler
*
* @return array
*/
protected function filterIncidentData($command)
protected function filter(UpdateIncidentCommand $command)
{
return array_filter([
'name' => $command->name,
@@ -96,7 +96,7 @@ class UpdateIncidentCommandHandler
'component_id' => $command->component_id,
'component_status' => $command->component_status,
'notify' => $command->notify,
]);
], 'is_null');
}
/**