ShareReportController::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 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