Passed
Push — master ( 28a360...d194a0 )
by Mihail
11:20
created

User   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 29
rs 10
wmc 3
lcom 0
cbo 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actionAuth() 0 11 2
A actionEndpoint() 0 4 1
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
class User extends ApiController
10
{
11
12
    /**
13
     * Check user auth.
14
     * @return string
15
     * @throws JsonException
16
     */
17
    public function actionAuth()
18
    {
19
        if (!App::$User->isAuth()) {
20
            throw new JsonException('No auth');
21
        }
22
23
        return json_encode([
24
            'status' => 1,
25
            'data' => 'Auth done'
26
        ]);
27
    }
28
29
    /**
30
     * Hybridauth endpoint.
31
     */
32
    public function actionEndpoint()
33
    {
34
        \Hybrid_Endpoint::process();
35
    }
36
37
}