TurboSmsServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 4 1
A register() 0 9 1
1
<?php
2
3
namespace NotificationChannels\TurboSms;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class TurboSmsServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Register the application services.
11
     */
12
    public function register()
13
    {
14
        $this->app->singleton(TurboSmsApi::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(TurboSmsApi::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
            $apiToken = $this->app['config']['services.turbosms.api_token'];
16
            $sender = $this->app['config']['services.turbosms.sender'];
17
      
18
            $client = new TurboSmsApi($apiToken, $sender, $this->app['config']['services.turbosms']);
19
            
20
            return $client;
21
        });
22
    }
23
24
    public function provides(): array
25
    {
26
        return [
27
            TurboSmsApi::class,
28
        ];
29
    }
30
}
31