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.

PaddleServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace ProtoneMedia\LaravelPaddle;
4
5
use Illuminate\Support\Facades\Blade;
6
use Illuminate\Support\Facades\Route;
7
use Illuminate\Support\ServiceProvider;
8
use ProtoneMedia\LaravelPaddle\Api\Api;
9
use ProtoneMedia\LaravelPaddle\Http\WebhookController;
10
11
class PaddleServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     */
16
    public function boot()
17
    {
18
        if ($this->app->runningInConsole()) {
19
            $this->publishes([
20
                __DIR__ . '/../config/config.php' => config_path('paddle.php'),
21
            ], 'config');
22
23
            $this->publishes([
24
                __DIR__ . '/../resources/views' => base_path('resources/views/vendor/paddle'),
25
            ], 'views');
26
        }
27
28
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'paddle');
29
30
        Blade::directive('paddle', function () {
31
            return "<?php echo view('paddle::javaScriptSetup'); ?>";
32
        });
33
    }
34
35
    /**
36
     * Register the application services.
37
     */
38
    public function register()
39
    {
40
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'paddle');
41
42
        $this->app->singleton('laravel-paddle', function () {
43
            return new Api;
44
        });
45
46
        Route::post(config('paddle.webhook_uri'), WebhookController::class);
47
    }
48
}
49