SitemapServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 16 1
A register() 0 3 1
1
<?php
2
3
namespace safaeean\Sitemap;
4
5
use safaeean\Crawler\Crawler;
0 ignored issues
show
Bug introduced by
The type safaeean\Crawler\Crawler 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...
6
use Illuminate\Support\ServiceProvider;
7
8
class SitemapServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-sitemap');
16
17
        $this->publishes([
18
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/laravel-sitemap'),
19
        ], 'views');
20
21
        $this->publishes([
22
            __DIR__.'/../config/sitemap.php' => config_path('sitemap.php'),
23
        ], 'config');
24
25
        $this->app->when(SitemapGenerator::class)
26
            ->needs(Crawler::class)
27
            ->give(function () {
28
                return Crawler::create(config('sitemap.guzzle_options'));
29
            });
30
    }
31
32
    /**
33
     * Register the application services.
34
     */
35
    public function register()
36
    {
37
        $this->mergeConfigFrom(__DIR__.'/../config/sitemap.php', 'sitemap');
38
    }
39
}
40