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

CustomizeGrouping   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 10 2
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