FcmServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace NotificationChannels\Fcm;
4
5
use GuzzleHttp\Client;
6
use Illuminate\Support\ServiceProvider;
7
8
class FcmServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        $this->app->when(FcmChannel::class)
16
            ->needs(Client::class)
17
            ->give(function () {
18
                return new Client([
19
                    'base_uri' => config('broadcasting.connections.fcm.url', FcmChannel::DEFAULT_API_URL),
20
                ]);
21
            });
22
    }
23
}
24