groupingType = $groupingType; } public function handle(Report $report, $next) { $report->groupByTopFrame(); if ($this->groupingType === GroupingTypes::EXCEPTION) { $report->groupByException(); } return $next($report); } }