LaravelWebPushServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 1
1
<?php
2
3
namespace AlexLisenkov\LaravelWebPush;
4
5
use AlexLisenkov\LaravelWebPush\Contracts\JWTGeneratorContract;
6
use AlexLisenkov\LaravelWebPush\Contracts\P256EncryptedMessageBuilderContract;
7
use AlexLisenkov\LaravelWebPush\Contracts\P256EncryptedMessageContract;
8
use AlexLisenkov\LaravelWebPush\Contracts\WebPushContract;
9
use Elliptic\EC;
10
use Illuminate\Support\ServiceProvider;
11
12
/**
13
 * @codeCoverageIgnore
14
 */
15
class LaravelWebPushServiceProvider extends ServiceProvider
16
{
17
    /**
18
     * Bootstrap services.
19
     *
20
     * @return void
21
     */
22
    public function boot(): void
23
    {
24
        $this->app->bind(WebPushContract::class, WebPush::class);
25
        $this->app->bind(P256EncryptedMessageBuilderContract::class, P256EncryptedMessageBuilder::class);
26
        $this->app->bind(P256EncryptedMessageContract::class, P256EncryptedMessage::class);
27
        $this->app->bind(JWTGeneratorContract::class, JWTGenerator::class);
28
        $this->app->bind(EC::class, static function () {
29
            return new EC('p256');
30
        });
31
32
        $this->publishes([
33
            __DIR__ . '/../config/laravel-web-push.php' => config_path(Constants::CONFIG_KEY . '.php'),
34
        ]);
35
    }
36
}
37