Issues (22)

src/ServiceProvider.php (1 issue)

1
<?php
2
3
namespace Fomvasss\Currency;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7
    /**
8
     * Bootstrap the application services.
9
     *
10
     * @return void
11
     */
12
    public function boot()
13
    {
14
        $this->publishes([
15
            __DIR__.'/../config/currency.php' => config_path('currency.php')
0 ignored issues
show
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

15
            __DIR__.'/../config/currency.php' => /** @scrutinizer ignore-call */ config_path('currency.php')
Loading history...
16
        ], 'config');
17
    }
18
19
    /**
20
     * Register the application services.
21
     *
22
     * @return void
23
     */
24
    public function register()
25
    {
26
        $this->mergeConfigFrom(__DIR__.'/../config/currency.php', 'currency');
27
28
        $this->registerCurrency();
29
30
    }
31
32
    public function registerCurrency()
33
    {
34
        $this->app->singleton('currency', function ($app) {
35
            return new Currency($app->config->get('currency', []));
36
        });
37
38
        $this->app->alias(Currency::class, 'fomvasss-currency');
39
    }
40
}
41