Completed
Push — master ( d306f8...b42bd6 )
by Derek Stephen
45:29
created

ResourceController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A resourceAction() 0 9 2
1
<?php
2
3
namespace App\Controller;
4
5
use OAuth2\Request;
6
7
class ResourceController extends OAuthController
8
{
9
10
    public function resourceAction()
11
    {
12
        $server = $this->oauth2Server;
13
        if (!$server->verifyResourceRequest(Request::createFromGlobals())) {
14
            $server->getResponse()->send();
15
            exit;
0 ignored issues
show
Coding Style Compatibility introduced by
The method resourceAction() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
16
        }
17
        $this->sendJsonResponse(['success' => true, 'message' => 'You accessed my APIs!']);
18
    }
19
}