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.
Completed
Push — master ( 685370...276e3f )
by Andreas
01:52
created

StandardServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 9

Test Coverage

Coverage 65%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 9
dl 0
loc 40
ccs 13
cts 20
cp 0.65
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B register() 0 34 2
1
<?php
2
/**
3
 * Starlit App.
4
 *
5
 * @copyright Copyright (c) 2016 Starweb AB
6
 * @license   BSD 3-Clause
7
 */
8
9
namespace Starlit\App\Provider;
10
11
use Starlit\App\BaseApp;
12
13
/**
14
 * @author Andreas Nilsson <http://github.com/jandreasn>
15
 */
16
class StandardServiceProvider implements ServiceProviderInterface
17
{
18
    /**
19
     * @param BaseApp $app
20
     */
21 20
    public function register(BaseApp $app)
22
    {
23
        $app->set('sessionStorage', function (BaseApp $app) {
24 1
            if ($app->isCli()) {
25 1
                return new \Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage();
26
            } else {
27
                return new \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage();
28
            }
29 20
        });
30
31
        $app->set('session', function (BaseApp $app) {
32 1
            return new \Symfony\Component\HttpFoundation\Session\Session($app->getNew('sessionStorage'));
33 20
        });
34
35
        $app->set('router', function (BaseApp $app) {
36 1
            return new \Starlit\App\Router($app, $app->getConfig()->get('router', []));
37 20
        });
38
39
        $app->set('view', function (BaseApp $app) {
40 3
            return new \Starlit\App\View($app->getConfig()->get('view', []));
41 20
        });
42
43
        // Default response (force no cache)
44 20
        $app->set('response', function () {
45
            $response = new \Symfony\Component\HttpFoundation\Response();
46
47
            $response->headers->addCacheControlDirective('no-cache', true);
48
            $response->headers->addCacheControlDirective('max-age', 0);
49
            $response->headers->addCacheControlDirective('must-revalidate', true);
50
            $response->headers->addCacheControlDirective('no-store', true);
51
52
            return $response;
53 20
        });
54 20
    }
55
}
56