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.

RunescapeServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Burthorpe\Runescape\Integrations\Laravel;
4
5
use Burthorpe\Runescape\Common;
6
use Burthorpe\Runescape\RS3\API as RS3;
7
use Illuminate\Support\ServiceProvider;
8
9
class RunescapeServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = false;
17
18
    /**
19
     * Bootstrap the application events.
20
     *
21
     * @return void
22
     */
23
    public function boot()
24
    {
25
        $this->registerCustomValidators();
26
    }
27
28
    /**
29
     * Register the service provider.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->app['burthorpe.runescape.common'] = $this->app->share(function () {
36
            return new Common();
37
        });
38
39
        $this->app['burthorpe.runescape.rs3'] = $this->app->share(function () {
40
            return new RS3();
41
        });
42
    }
43
44
    /**
45
     * Get the services provided by the provider.
46
     *
47
     * @return array
48
     */
49
    public function provides()
50
    {
51
        return ['burthorpe.runescape.api', 'burthorpe.runescape.eoc'];
52
    }
53
54
    /**
55
     * Register the runescape_display_name validation rule with Laravel's validator
56
     *
57
     * @return void
58
     */
59
    public function registerCustomValidators()
60
    {
61
        $this->app->make('validator')->extend('runescape_display_name', '\Burthorpe\Runescape\Integrations\Laravel\Validator@validateDisplayName', ':attribute must be a valid Runescape Display Name (Maximum of 12 characters and only contain letters, numbers, dashes, underscores and spaces)');
62
    }
63
}
64