1 | <?php namespace Blok\JavaScript; |
||||
2 | |||||
3 | use Illuminate\Support\Facades\Blade; |
||||
4 | use Illuminate\Support\ServiceProvider; |
||||
5 | |||||
6 | class JavaScriptServiceProvider extends ServiceProvider |
||||
7 | { |
||||
8 | protected $defer = false; |
||||
9 | |||||
10 | public function register() |
||||
11 | { |
||||
12 | $this->app->singleton('JavaScript', function ($app) { |
||||
0 ignored issues
–
show
|
|||||
13 | return new JavaScript(config('javascript.namespace')); |
||||
0 ignored issues
–
show
The function
config 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
![]() |
|||||
14 | }); |
||||
15 | } |
||||
16 | |||||
17 | public function boot() |
||||
18 | { |
||||
19 | require_once __DIR__ . '/helpers.php'; |
||||
20 | |||||
21 | $this->publishes([ |
||||
22 | __DIR__ . '/config/javascript.php' => config_path('javascript.php'), |
||||
0 ignored issues
–
show
The function
config_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
![]() |
|||||
23 | ], 'config'); |
||||
24 | |||||
25 | /** |
||||
26 | * @example |
||||
27 | * @javascript($namespace, (optional) $array) |
||||
28 | */ |
||||
29 | Blade::directive('javascript', function ($expression) { |
||||
30 | return "<?php echo JavaScript::render({$expression}); ?>"; |
||||
31 | }); |
||||
32 | } |
||||
33 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.