ServiceProvider   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setupConfig() 0 11 4
A boot() 0 3 1
A register() 0 5 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 38
    public function register()
17
    {
18 38
        $this->app->bind(
19
            \GraphQL\Executor\Promise\PromiseAdapter::class,
20
            \GraphQL\Executor\Promise\Adapter\AmpPromiseAdapter::class
21
        );
22
    }
23
24
    /**
25
     * Boot the service provider.
26
     *
27
     * @return void
28
     */
29 38
    public function boot()
30
    {
31 38
        $this->setupConfig($this->app);
32
    }
33
34 38
    private function setupConfig($app)
35
    {
36 38
        $source = realpath(__DIR__ . '/../config/butler.php');
37
38 38
        if ($app instanceof LaravelApplication && $app->runningInConsole()) {
39 38
            $this->publishes([$source => config_path('butler.php')]);
40
        } elseif ($app instanceof LumenApplication) {
41
            $app->configure('butler');
42
        }
43
44 38
        $this->mergeConfigFrom($source, 'butler');
45
    }
46
}
47