GcmServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 6
dl 0
loc 20
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 1
1
<?php
2
3
namespace NotificationChannels\Gcm;
4
5
use Zend\Http\Client\Adapter\Curl;
6
use ZendService\Google\Gcm\Client;
7
use Illuminate\Support\ServiceProvider;
8
9
class GcmServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function register()
15
    {
16
        $this->app->when(GcmChannel::class)
17
            ->needs(Client::class)
18
            ->give(function () {
19
                $gcmConfig = config('broadcasting.connections.gcm');
20
21
                $client = new Client();
22
                $client->setApiKey($gcmConfig['key']);
23
                $client->getHttpClient()->setAdapter(new Curl());
24
25
                return $client;
26
            });
27
    }
28
}
29