SmsirServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 2 1
A register() 0 10 2
1
<?php
2
3
namespace Rezahmady\Smsir;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class SmsirServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        // Bootstrap code here.
15
    }
16
17
    /**
18
     * Register the application services.
19
     */
20
    public function register()
21
    {
22
        $this->mergeConfigFrom(__DIR__ . '/../configs/smsir.php', 'smsir');
23
        if ($this->app->runningInConsole()) {
24
            $this->publishes([
25
                __DIR__ . '/../configs/smsir.php' => config_path('smsir.php'),
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

25
                __DIR__ . '/../configs/smsir.php' => /** @scrutinizer ignore-call */ config_path('smsir.php'),
Loading history...
26
            ], 'config');
27
        }
28
        $this->app->bind('smsir', 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

28
        $this->app->bind('smsir', 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...
29
            return new SmsirClient(config('smsir.api-key'), config('smsir.secret-key'), config('smsir.line-number'), config('smsir.request-timeout'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

29
            return new SmsirClient(/** @scrutinizer ignore-call */ config('smsir.api-key'), config('smsir.secret-key'), config('smsir.line-number'), config('smsir.request-timeout'));
Loading history...
30
        });
31
    }
32
}
33