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.

ResourcefulServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 1
ccs 8
cts 8
cp 1
crap 1
1
<?php
2
3
namespace JDesrosiers\Resourceful\ResourcefulServiceProvider;
4
5
use JDesrosiers\Resourceful\FileCache\FileCache;
6
use Pimple\Container;
7
use Pimple\ServiceProviderInterface;
8
use Silex\Api\BootableProviderInterface;
9
use Silex\Application;
10
use Silex\Provider\TwigServiceProvider;
11
use Twig_Loader_Filesystem;
12
13
class ResourcefulServiceProvider implements ServiceProviderInterface, BootableProviderInterface
14
{
15
    const ERROR_HANDLER_PRIORITY = 0;
16
17 9
    public function boot(Application $app)
18
    {
19
        // Error Handling
20 9
        $schema = $app["url_generator"]->generate("schema", ["type" => "error"]);
21
22 9
        $app["twig.loader"]->addLoader(new Twig_Loader_Filesystem(__DIR__ . "/templates"));
23 9
        $app->before(new AddSchema($schema, "error"));
24
25 9
        $app->error(function (\Exception $e, $code) use ($app, $schema) {
0 ignored issues
show
Unused Code introduced by
The parameter $e is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $code is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26 2
            $app["json-schema.describedBy"] = $schema;
27 9
        }, self::ERROR_HANDLER_PRIORITY);
28 9
    }
29
30 9
    public function register(Container $app)
31
    {
32 9
        $twigProvider = new TwigServiceProvider();
33 9
        $twigProvider->register($app);
34
35 9
        $app["resources_factory"] = $app->protect(new ResourcesFactory($app));
36 9
        $app["resourceful.defaultSchemaVersion"] = "http://json-schema.org/hyper-schema";
37
        $app["resourceful.schemas"] = function (Container $app) {
38
            return new FileCache($app["resourceful.schema-dir"]);
39
        };
40
    }
41
}
42