Test Failed
Push — develop ( 687356...3663ad )
by Nuno
03:21
created

EngineManager::createAlgoliaDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.037

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 2
cts 3
cp 0.6667
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1.037
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Scout Extended.
7
 *
8
 * (c) Algolia Team <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Algolia\ScoutExtended\Managers;
15
16
use Algolia\AlgoliaSearch\Client;
0 ignored issues
show
Bug introduced by
The type Algolia\AlgoliaSearch\Client 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...
17
use Algolia\AlgoliaSearch\Support\UserAgent;
0 ignored issues
show
Bug introduced by
The type Algolia\AlgoliaSearch\Support\UserAgent 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...
18
use Algolia\ScoutExtended\Engines\AlgoliaEngine;
19
use Laravel\Scout\EngineManager as BaseEngineManager;
20
21
final class EngineManager extends BaseEngineManager
22
{
23
    /**
24
     * Create an Algolia engine instance.
25
     *
26
     * @return \Algolia\ScoutExtended\Engines\AlgoliaEngine
27
     */
28 16
    public function createAlgoliaDriver(): AlgoliaEngine
29
    {
30 16
        UserAgent::addCustomUserAgent('Laravel Scout Extended', '1.0.0');
31
32
        return new AlgoliaEngine(Client::create(config('scout.algolia.id'), config('scout.algolia.secret')));
33
    }
34
}
35