configurePackage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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