Test Failed
Push — master ( cb9afd...2b9e35 )
by Maximo
02:09
created

AuthController::onConstruct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
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 Exception;
8
use Gewaer\Models\Users;
9
use Gewaer\Models\UserLinkedSources;
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 Exception('You need to configure your app JWT');
29
        }
30
    }
31
}
32