ShareReportController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 2
1
<?php
2
3
namespace Facade\Ignition\Http\Controllers;
4
5
use Facade\Ignition\Actions\ShareReportAction;
6
use Facade\Ignition\Exceptions\UnableToShareErrorException;
7
use Facade\Ignition\Http\Requests\ShareReportRequest;
8
9
class ShareReportController
10
{
11
    public function __invoke(ShareReportRequest $request, ShareReportAction $shareReportAction)
12
    {
13
        try {
14
            return $shareReportAction->handle(json_decode($request->get('report'), true), $request->get('tabs'), $request->get('lineSelection'));
15
        } catch (UnableToShareErrorException $exception) {
16
            abort(500, 'Unable to share the error '.$exception->getMessage());
17
        }
18
    }
19
}
20