Test Failed
Push — develop ( 3663ad...1f9f00 )
by Nuno
04:47
created

EngineManager::createAlgoliaDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.125

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1.125
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
use Algolia\ScoutExtended\Searchable\ObjectIdEncrypter;
21
use Algolia\ScoutExtended\Searchable\ObjectsResolver;
22
23
class EngineManager extends BaseEngineManager
24
{
25
    /**
26
     * Create an Algolia engine instance.
27
     *
28
     * @return \Algolia\ScoutExtended\Engines\AlgoliaEngine
29
     */
30 16
    public function createAlgoliaDriver(): AlgoliaEngine
31
    {
32 16
        UserAgent::addCustomUserAgent('Laravel Scout Extended', '1.0.0');
33
34
        return new AlgoliaEngine(Client::create(config('scout.algolia.id'), config('scout.algolia.secret')),
35
            app(ObjectsResolver::class)
36
        );
37
    }
38
}
39