LaravelCryptoStatsProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LaravelCryptoStats;
4
5
use Illuminate\Support\ServiceProvider;
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\ServiceProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use LaravelCryptoStats\Connectors\ChainsoConnector;
7
use LaravelCryptoStats\Connectors\EtherscanConnector;
8
9
class LaravelCryptoStatsProvider extends ServiceProvider
10
{
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = true;
17
18
    /**
19
     * Bootstrap services.
20
     *
21
     * @return void
22
     */
23
    public function boot()
24
    {
25
        $this->publishes([
26
            __DIR__.'/../config/laravel_crypto_stats.php' => config_path('laravel_crypto_stats.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

26
            __DIR__.'/../config/laravel_crypto_stats.php' => /** @scrutinizer ignore-call */ config_path('laravel_crypto_stats.php'),
Loading history...
27
        ]);
28
    }
29
30
    /**
31
     * Register services.
32
     *
33
     * @return void
34
     */
35
    public function register()
36
    {
37
        $this->app->bind('laravel-crypto-stats', function () {
38
            return new LaravelCryptoStats();
39
        });
40
41
        $this->app->bind('chainso', function () {
42
            return new ChainsoConnector();
43
        });
44
45
        $this->app->bind('etherscan', function () {
46
            return new EtherscanConnector();
47
        });
48
49
        $this->app->tag(['chainso', 'etherscan'], 'laravel-crypto-stats.connectors');
50
    }
51
52
    /**
53
     * Get the services provided by the provider.
54
     *
55
     * @return array
56
     */
57
    public function provides()
58
    {
59
        return ['laravel-crypto-stats', 'chainso', 'etherscan'];
60
    }
61
}
62