SendberryServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 12
c 1
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 4 1
A register() 0 12 1
1
<?php
2
3
namespace NotificationChannels\Sendberry;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class SendberryServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Register the application services.
11
     */
12
    public function register()
13
    {
14
        $this->app->singleton(SendberryApi::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
        $this->app->singleton(SendberryApi::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
            $username = $this->app['config']['services.sendberry.username'];
16
            $password = $this->app['config']['services.sendberry.password'];
17
            $authKey = $this->app['config']['services.sendberry.auth_key'];
18
            $from = $this->app['config']['services.sendberry.from'];
19
            $testMode = $this->app['config']['services.sendberry.test_mode'];
20
            $webhook = $this->app['config']['services.sendberry.webhook'];
21
            $client = new SendberryApi($authKey, $username, $password, $from, $webhook, $testMode);
22
23
            return $client;
24
        });
25
    }
26
27
    public function provides(): array
28
    {
29
        return [
30
            SendberryApi::class,
31
        ];
32
    }
33
}
34