Passed
Push — master ( 73b946...893eb4 )
by
unknown
09:22
created

ServiceProvider   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 86.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 11
c 1
b 0
f 0
dl 0
loc 36
ccs 13
cts 15
cp 0.8667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 1
A setupConfig() 0 11 4
A boot() 0 3 1
1
<?php
2
3
namespace Butler\Graphql;
4
5
use Illuminate\Foundation\Application as LaravelApplication;
6
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
7
use Laravel\Lumen\Application as LumenApplication;
0 ignored issues
show
Bug introduced by
The type Laravel\Lumen\Application 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...
8
9
class ServiceProvider extends BaseServiceProvider
10
{
11
    /**
12
     * Register the service provider.
13
     *
14
     * @return void
15
     */
16 32
    public function register()
17
    {
18 32
        $this->app->bind(
19 32
            \GraphQL\Executor\Promise\PromiseAdapter::class,
20 32
            \GraphQL\Executor\Promise\Adapter\AmpPromiseAdapter::class
21
        );
22 32
    }
23
24
    /**
25
     * Boot the service provider.
26
     *
27
     * @return void
28
     */
29 32
    public function boot()
30
    {
31 32
        $this->setupConfig($this->app);
32 32
    }
33
34 32
    private function setupConfig($app)
35
    {
36 32
        $source = realpath(__DIR__ . '/../config/butler.php');
37
38 32
        if ($app instanceof LaravelApplication && $app->runningInConsole()) {
39 32
            $this->publishes([$source => config_path('butler.php')]);
40
        } elseif ($app instanceof LumenApplication) {
41
            $app->configure('butler');
42
        }
43
44 32
        $this->mergeConfigFrom($source, 'butler');
45 32
    }
46
}
47