Passed
Push — master ( 94a081...338d1c )
by Biao
03:36
created

ServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 19 1
A provides() 0 3 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Hhxsv5\LaravelS\Components\Prometheus;
4
5
use Hhxsv5\LaravelS\Components\Prometheus\Collectors\HttpRequestCollector;
6
use Hhxsv5\LaravelS\Components\Prometheus\Collectors\SwooleProcessCollector;
7
use Hhxsv5\LaravelS\Components\Prometheus\Collectors\SwooleStatsCollector;
8
use Hhxsv5\LaravelS\Components\Prometheus\Collectors\SystemCollector;
9
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\ServiceProvider 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...
10
11
class ServiceProvider extends BaseServiceProvider
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class ServiceProvider
Loading history...
12
{
13
    protected $defer = true;
14
15
    public function boot()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function boot()
Loading history...
16
    {
17
        $this->publishes([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
18
            __DIR__ . '/../../../config/prometheus.php' => base_path('config/prometheus.php'),
0 ignored issues
show
Bug introduced by
The function base_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

18
            __DIR__ . '/../../../config/prometheus.php' => /** @scrutinizer ignore-call */ base_path('config/prometheus.php'),
Loading history...
19
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
20
    }
21
22
    public function register()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function register()
Loading history...
23
    {
24
        $this->mergeConfigFrom(
25
            __DIR__ . '/../../../config/prometheus.php', 'prometheus'
26
        );
27
        $this->app->singleton(HttpRequestCollector::class, function ($app) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
28
            return new HttpRequestCollector($app['config']->get('prometheus'));
29
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
30
        $this->app->singleton(SwooleProcessCollector::class, function ($app) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
31
            return new SwooleProcessCollector($app['config']->get('prometheus'));
32
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
33
        $this->app->singleton(SwooleStatsCollector::class, function ($app) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
34
            return new SwooleStatsCollector($app['config']->get('prometheus'));
35
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
36
        $this->app->singleton(SystemCollector::class, function ($app) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
37
            return new SystemCollector($app['config']->get('prometheus'));
38
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
39
        $this->app->singleton(Exporter::class, function ($app) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
40
            return new Exporter($app['config']->get('prometheus'));
41
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
42
    }
43
44
    public function provides()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function provides()
Loading history...
45
    {
46
        return [HttpRequestCollector::class, SwooleProcessCollector::class, SwooleStatsCollector::class, SystemCollector::class, Exporter::class];
47
    }
48
}