User   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actionEndpoint() 0 3 1
A actionAuth() 0 10 2
1
<?php
2
3
namespace Apps\Controller\Api;
4
5
use Extend\Core\Arch\ApiController;
6
use Ffcms\Core\App;
7
use Ffcms\Core\Exception\JsonException;
8
9
/**
10
 * Class User. User api features controller
11
 * @package Apps\Controller\Api
12
 */
13
class User extends ApiController
14
{
15
16
    /**
17
     * Check user auth.
18
     * @return string
19
     * @throws JsonException
20
     */
21
    public function actionAuth()
22
    {
23
        $this->setJsonHeader();
24
        if (!App::$User->isAuth()) {
25
            throw new JsonException('No auth');
26
        }
27
28
        return json_encode([
29
            'status' => 1,
30
            'data' => 'Auth done'
31
        ]);
32
    }
33
34
    /**
35
     * Hybridauth endpoint.
36
     */
37
    public function actionEndpoint()
38
    {
39
        \Hybrid_Endpoint::process();
40
    }
41
}
42