Passed
Push — master ( f07f01...23a19f )
by Syed Abidur
01:20 queued 14s
created

ServiceProviderForLaravel4::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Sarahman\OauthTokensClient;
4
5
use Config;
6
use GuzzleHttp\Client;
7
use Illuminate\Support\ServiceProvider;
8
9
class ServiceProviderForLaravel4 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 the application events.
20
     *
21
     * @return void
22
     */
23
    public function boot()
24
    {
25
        $this->package('sarahman/oauth-tokens-client', null, __DIR__);
0 ignored issues
show
Bug introduced by
The method package() does not exist on Sarahman\OauthTokensClie...viceProviderForLaravel4. ( Ignorable by Annotation )

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

25
        $this->/** @scrutinizer ignore-call */ 
26
               package('sarahman/oauth-tokens-client', null, __DIR__);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
27
        include __DIR__ . '/config/config.php';
28
    }
29
30
    /**
31
     * Register the service provider.
32
     *
33
     * @return void
34
     */
35
    public function register()
36
    {
37
        $this->app['oauth-tokens-client.service'] = $this->app->share(function ($app) {
0 ignored issues
show
Bug introduced by
The method share() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

37
        /** @scrutinizer ignore-call */ 
38
        $this->app['oauth-tokens-client.service'] = $this->app->share(function ($app) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
            return new OAuthClient(
39
                new Client,
40
                $app['cache.store'],
41
                Config::get('oauth-tokens-client::OAUTH_CREDENTIAL'),
42
                Config::get('oauth-tokens-client::TOKEN_PREFIXES'),
43
                Config::get('oauth-tokens-client::LOCK_KEY')
44
            );
45
        });
46
    }
47
48
    /**
49
     * Get the services provided by the provider.
50
     *
51
     * @return array
52
     */
53
    public function provides()
54
    {
55
        return array('oauth-tokens-client.service');
56
    }
57
}
58