Passed
Push — master ( 97acdc...e0760a )
by Caen
03:49 queued 17s
created

RealtimeCompilerServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 6
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 19
rs 10
c 6
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A boot() 0 12 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\RealtimeCompiler;
6
7
use Illuminate\Support\ServiceProvider;
8
use Hyde\RealtimeCompiler\Http\LiveEditController;
9
use Hyde\RealtimeCompiler\Http\DashboardController;
0 ignored issues
show
Bug introduced by
The type Hyde\RealtimeCompiler\Http\DashboardController 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
use Hyde\RealtimeCompiler\Http\VirtualRouteController;
11
12
class RealtimeCompilerServiceProvider extends ServiceProvider
13
{
14
    public function register(): void
15
    {
16
        $this->app->singleton(RealtimeCompiler::class);
17
    }
18
19
    public function boot(): void
20
    {
21
        $router = $this->app->make(RealtimeCompiler::class);
22
23
        $router->registerVirtualRoute('/ping', [VirtualRouteController::class, 'ping']);
24
25
        if (DashboardController::enabled()) {
26
            $router->registerVirtualRoute('/dashboard', [VirtualRouteController::class, 'dashboard']);
27
        }
28
29
        if (LiveEditController::enabled()) {
30
            $router->registerVirtualRoute('/_hyde/live-edit', [VirtualRouteController::class, 'liveEdit']);
31
        }
32
    }
33
}
34