1 | <?php |
||||
2 | |||||
3 | namespace ProtoneMedia\LaravelTracer; |
||||
4 | |||||
5 | use Illuminate\Http\Request; |
||||
6 | use Illuminate\Support\ServiceProvider; |
||||
7 | |||||
8 | class LaravelTracerServiceProvider extends ServiceProvider |
||||
9 | { |
||||
10 | /** |
||||
11 | * Bootstrap the application services. |
||||
12 | */ |
||||
13 | public function boot() |
||||
14 | { |
||||
15 | if ($this->app->runningInConsole()) { |
||||
16 | $this->publishes([ |
||||
17 | __DIR__ . '/../config/config.php' => config_path('laravel-tracer.php'), |
||||
18 | ], 'config'); |
||||
19 | |||||
20 | if (!class_exists('CreateUserRequestsTable')) { |
||||
21 | $this->publishes([ |
||||
22 | __DIR__ . '/../database/migrations/create_user_requests_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_user_requests_table.php'), |
||||
23 | ], 'migrations'); |
||||
24 | } |
||||
25 | } |
||||
26 | } |
||||
27 | |||||
28 | /** |
||||
29 | * Register the application services. |
||||
30 | */ |
||||
31 | public function register() |
||||
32 | { |
||||
33 | $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'laravel-tracer'); |
||||
34 | |||||
35 | // setter for the qualified route |
||||
36 | Request::macro('qualifyAs', function (string $name, $secondsBetweenLogs = null) { |
||||
37 | $this->qualifiedRoute = new QualifiedRoute($this->route(), $name, $secondsBetweenLogs); |
||||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() The method
route() does not exist on ProtoneMedia\LaravelTrac...elTracerServiceProvider .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. ![]() |
|||||
38 | }); |
||||
39 | |||||
40 | // getter for the qualified route |
||||
41 | Request::macro('qualifiedRoute', function (): QualifiedRoute { |
||||
42 | return $this->qualifiedRoute ?: QualifiedRoute::fromRequest($this); |
||||
0 ignored issues
–
show
$this of type ProtoneMedia\LaravelTrac...elTracerServiceProvider is incompatible with the type Illuminate\Http\Request expected by parameter $request of ProtoneMedia\LaravelTrac...iedRoute::fromRequest() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
43 | }); |
||||
44 | } |
||||
45 | } |
||||
46 |