SearchMock   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSearchEngineExtensions() 0 8 1
A getNaturalSeoResult() 0 4 1
A getSemResult() 0 4 1
A getTownCode() 0 4 1
A getUrlRankByKeyword() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * MyPoseo API Bundle
7
 *
8
 * @author Tristan Bessoussa <[email protected]>
9
 */
10
11
namespace Tristanbes\MyPoseoBundle\Api;
12
13
use Tristanbes\MyPoseoBundle\Connection\RestClient;
14
15
/**
16
 * Class used when the application is in test environment
17
 */
18
class SearchMock implements SearchInterface
19
{
20
    private $client;
21
22
    public function __construct(RestClient $client)
23
    {
24
        $this->client = $client;
25
    }
26
27
    public function getSearchEngineExtensions(string $searchEngine, ?int $ttl = null): array
28
    {
29
        $data             = [];
30
        $data[13]['id']   = 13;
31
        $data[13]['name'] = '.fr (fr)';
32
33
        return $data;
34
    }
35
36
    public function getNaturalSeoResult()
37
    {
38
        throw new \RuntimeException(sprintf('Method "%s" is not implemented.', __METHOD__));
39
    }
40
41
    public function getSemResult()
42
    {
43
        throw new \RuntimeException(sprintf('Method "%s" is not implemented.', __METHOD__));
44
    }
45
46
    public function getTownCode(string $name, string $country = 'FR'): array
47
    {
48
        throw new \RuntimeException(sprintf('Method "%s" is not implemented.', __METHOD__));
49
    }
50
51
    public function getUrlRankByKeyword(string $keyword, string $url, string $searchEngine = 'google', ?string $callbackUrl = null, ?int $geolocId = null, int $location = 13, ?int $maxPage = null): array
52
    {
53
        throw new \RuntimeException(sprintf('Method "%s" is not implemented.', __METHOD__));
54
    }
55
}
56