SolrProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 3
b 0
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 15 1
1
<?php
2
3
namespace ScoutEngines\Solr;
4
5
use Illuminate\Support\ServiceProvider;
6
use Laravel\Scout\EngineManager;
7
use Solarium\Client;
8
9
class SolrProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        app(EngineManager::class)->extend('solr', function ($app) {
0 ignored issues
show
Bug introduced by
The function app 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

16
        /** @scrutinizer ignore-call */ 
17
        app(EngineManager::class)->extend('solr', function ($app) {
Loading history...
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

16
        app(EngineManager::class)->extend('solr', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
            $config = [
18
                'endpoint' => [
19
                    'default' => [
20
                        'host' => config('scout.solr.host'),
0 ignored issues
show
Bug introduced by
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 ignore-call  annotation

20
                        'host' => /** @scrutinizer ignore-call */ config('scout.solr.host'),
Loading history...
21
                        'port' => config('scout.solr.port'),
22
                        'path' => config('scout.solr.path'),
23
                        'core' => config('scout.solr.core'),
24
                    ],
25
                ],
26
            ];
27
28
            return new SolrEngine(new Client($config));
29
        });
30
    }
31
}
32