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 ( a4102e...b25063 )
by Jason
02:02
created

CorsServiceProvider::determineAllowedMethods()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 13
cts 13
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 11
nc 3
nop 1
crap 3
1
<?php
2
3
namespace JDesrosiers\Silex\Provider;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
use Silex\Api\BootableProviderInterface;
8
use Silex\Application;
9
10
/**
11
 * The CORS service provider provides a `cors` service that a can be included in your project as application middleware.
12
 */
13
class CorsServiceProvider implements ServiceProviderInterface, BootableProviderInterface
14
{
15
    /**
16
     * Add OPTIONS method support for all routes
17
     *
18
     * @param Application $app
19
     */
20 18
    public function boot(Application $app)
21
    {
22 18
        $app->options("{route}", new OptionsController())
23 18
            ->assert("route", ".+");
24 18
    }
25
26
    /**
27
     * Register the cors function and set defaults
28
     *
29
     * @param Application $app
30
     */
31 18
    public function register(Container $app)
32
    {
33 18
        $app["cors.allowOrigin"] = "*"; // Defaults to all
34 18
        $app["cors.allowMethods"] = null; // Defaults to all
35 18
        $app["cors.maxAge"] = null;
36 18
        $app["cors.allowCredentials"] = null;
37 18
        $app["cors.exposeHeaders"] = null;
38
39 18
        $app["cors"] = $app->protect(new Cors($app));
40 18
    }
41
}
42