Issues (4)

src/ServiceProviderForLaravelRecent.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Sarahman\OauthTokensClient;
4
5
use GuzzleHttp\Client;
6
use Illuminate\Support\ServiceProvider;
7
8
class ServiceProviderForLaravelRecent extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        // Publishes the configuration file
13
        $this->publishes([
14
            __DIR__ . '/config/config.php' => config_path('oauth-tokens-client.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

14
            __DIR__ . '/config/config.php' => /** @scrutinizer ignore-call */ config_path('oauth-tokens-client.php'),
Loading history...
15
        ], 'config');
16
    }
17
18
    public function register()
19
    {
20
        // Merges default configuration
21
        $this->mergeConfigFrom(__DIR__ . '/config/config.php', 'oauth-tokens-client');
22
23
        $this->app->bind('oauth-tokens-client.service', function ($app) {
24
            $oauthTokenConfig = $app->make('config')->get('oauth-tokens-client');
25
26
            return new OAuthClient(
27
                new Client,
28
                $app['cache.store'],
29
                $oauthTokenConfig['OAUTH_CREDENTIAL'],
30
                $oauthTokenConfig['TOKEN_PREFIXES'],
31
                $oauthTokenConfig['LOCK_KEY']
32
            );
33
        });
34
    }
35
}
36