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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 4
c 3
b 1
f 0
lcom 1
cbo 4
dl 0
loc 55
ccs 0
cts 15
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 10 1
A provides() 0 4 1
A registerCustomValidators() 0 4 1
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