protected function log($type, $value, Entity $entity = null) { if (is_array($value)) { $value = array_filter(array_filter($value, function ($property) { return !is_array($property); })); if ($value) { if (!($value = $entity->filterImportantUpdatedAttributes($value))) { return; } } $value['id'] = $entity->id; } else { $value = array_merge(['id' => $entity->id], @$value); } $this->statistics[$type][] = $value; }