StripeIntegrationServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 25
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A packageRegistered() 0 4 1
A configurePackage() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MichaelRubel\StripeIntegration;
6
7
use Spatie\LaravelPackageTools\Package;
8
use Spatie\LaravelPackageTools\PackageServiceProvider;
9
use Stripe\StripeClient;
10
11
class StripeIntegrationServiceProvider extends PackageServiceProvider
12
{
13
    /**
14
     * Configure the package.
15
     *
16
     * @param  Package  $package
17
     *
18
     * @return void
19
     */
20 25
    public function configurePackage(Package $package): void
21
    {
22 25
        $package
23 25
            ->name('laravel-stripe-integration')
24 25
            ->hasConfigFile();
25
    }
26
27
    /**
28
     * Register any package services.
29
     *
30
     * @return void
31
     */
32 25
    public function packageRegistered(): void
33
    {
34 25
        $this->app->bind(StripeClient::class, fn () => new StripeClient(
35 25
            config('stripe-integration.secret', env('STRIPE_SECRET'))
36 25
        ));
37
    }
38
}
39