Test Failed
Push — master ( baab8c...6507f4 )
by Maximo
01:50
created

AuthController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A onConstruct() 0 7 2
1
<?php
0 ignored issues
show
Coding Style introduced by
End of line character is invalid; expected "\n" but found "\r\n"
Loading history...
2
3
declare(strict_types=1);
4
5
namespace Gewaer\Api\Controllers;
6
7
use Gewaer\Models\Users;
8
use Gewaer\Models\UserLinkedSources;
9
use Gewaer\Exception\ServerErrorHttpException;
10
11
/**
12
 * Base controller
13
 *
14
 */
15
class AuthController extends \Baka\Auth\AuthController
16
{
17
    /**
18
     * Setup for this controller
19
     *
20
     * @return void
21
     */
22
    public function onConstruct()
23
    {
24
        $this->userLinkedSourcesModel = new UserLinkedSources();
25
        $this->userModel = new Users();
26
27
        if (!isset($this->config->jwt)) {
0 ignored issues
show
Bug Best Practice introduced by
The property config does not exist on Gewaer\Api\Controllers\AuthController. Since you implemented __get, consider adding a @property annotation.
Loading history...
28
            throw new ServerErrorHttpException('You need to configure your app JWT');
29
        }
30
    }
31
}
32