GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Resourceful::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1.008

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 9.536
c 0
b 0
f 0
cc 1
nc 1
nop 1
ccs 8
cts 10
cp 0.8
crap 1.008
1
<?php
2
3
namespace JDesrosiers\Resourceful;
4
5
use JDesrosiers\Resourceful\JsonErrorHandler\JsonErrorHandler;
6
use JDesrosiers\Silex\Provider\ContentNegotiationServiceProvider;
7
use JDesrosiers\Silex\Provider\CorsServiceProvider;
8
use JDesrosiers\Silex\Provider\JsonSchemaServiceProvider;
9
use Silex\Application;
10
use Symfony\Component\Debug\ErrorHandler;
11
12
class Resourceful extends Application
13
{
14 18
    public function __construct($config = [])
15
    {
16 18
        parent::__construct($config);
17 18
        ErrorHandler::register();
18
19
        // JSON/REST application
20 18
        $this->register(new ContentNegotiationServiceProvider(), [
21 18
            "conneg.responseFormats" => ["json"],
22
            "conneg.requestFormats" => ["json"],
23
            "conneg.defaultFormat" => "json",
24
        ]);
25 18
        $this->register(new CorsServiceProvider());
26
27
        // JSON Schema application
28 18
        $this->register(new JsonSchemaServiceProvider());
29
30
        // Error Handling
31 18
        $this->error(new JsonErrorHandler($this));
32
33
        // CreateResourceController
34
        $this["uniqid"] = function () {
35
            return uniqid();
36
        };
37
    }
38
}
39