FormioController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 14
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A jwt() 0 3 1
1
<?php
2
3
namespace Spinen\Formio\Http\Controllers;
4
5
use Exception;
6
use Illuminate\Http\Request;
7
use Illuminate\Routing\Controller;
8
use Spinen\Formio\Client as Formio;
9
use Spinen\Formio\Http\Resources\FormioJwt;
10
11
/**
12
 * Class FormioController
13
 *
14
 * @package Spinen\Formio\Http\Controllers
15
 */
16
class FormioController extends Controller
17
{
18
    /**
19
     * The JWT for Formio for the logged in user
20
     *
21
     * @param Request $request
22
     * @param Formio $formio
23
     *
24
     * @return FormioJwt
25
     * @throws Exception
26
     */
27 2
    public function jwt(Request $request, Formio $formio)
28
    {
29 2
        return FormioJwt::make($formio->sso($request->user())->token);
30
    }
31
}
32