StripeWebhooksServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 2
A register() 0 4 1
1
<?php
2
3
namespace Spatie\StripeWebhooks;
4
5
use Illuminate\Support\Facades\Route;
6
use Illuminate\Support\ServiceProvider;
7
8
class StripeWebhooksServiceProvider extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        if ($this->app->runningInConsole()) {
13
            $this->publishes([
14
                __DIR__.'/../config/stripe-webhooks.php' => config_path('stripe-webhooks.php'),
15
            ], 'config');
16
        }
17
18
        Route::macro('stripeWebhooks', function ($url) {
19
            return Route::post($url, '\Spatie\StripeWebhooks\StripeWebhooksController');
20
        });
21
    }
22
23
    public function register()
24
    {
25
        $this->mergeConfigFrom(__DIR__.'/../config/stripe-webhooks.php', 'stripe-webhooks');
26
    }
27
}
28