ServiceProviderForLaravel4   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 3 1
A boot() 0 6 1
A register() 0 9 1
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
        $this->package('sarahman/laravel-http-request-api-log', null, __DIR__ . '/../../../../laravel-http-request-api-log/src');
27
28
        include __DIR__ . '/config/config.php';
29
    }
30
31
    /**
32
     * Register the service provider.
33
     *
34
     * @return void
35
     */
36
    public function register()
37
    {
38
        $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

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