Completed
Push — master ( 6a1d32...edb848 )
by Marcel
16:55
created

CustomizeGrouping::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
namespace Facade\Ignition\Middleware;
4
5
use Facade\FlareClient\Report;
6
use Facade\FlareClient\Enums\GroupingTypes;
7
8
class CustomizeGrouping
9
{
10
    protected $groupingType;
11
12
    public function __construct($groupingType)
13
    {
14
        $this->groupingType = $groupingType;
15
    }
16
17
    public function handle(Report $report, $next)
18
    {
19
        $report->groupByTopFrame();
20
21
        if ($this->groupingType === GroupingTypes::EXCEPTION) {
22
            $report->groupByException();
23
        }
24
25
        return $next($report);
26
    }
27
}
28