IntegrationTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCacheDir() 0 3 1
A createProvider() 0 3 1
A getApiKey() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Geocoder package.
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @license    MIT License
9
 */
10
11
namespace Geocoder\Provider\Photon\Tests;
12
13
use Geocoder\IntegrationTest\ProviderIntegrationTest;
14
use Geocoder\Provider\Photon\Photon;
15
use Http\Client\HttpClient;
16
17
/**
18
 * @author Tobias Nyholm <[email protected]>
19
 */
20
class IntegrationTest extends ProviderIntegrationTest
21
{
22
    protected $testAddress = true;
23
24
    protected $testReverse = true;
25
26
    protected $testIpv4 = false;
27
28
    protected $testIpv6 = false;
29
30
    protected $skippedTests = [
31
        'testGeocodeQuery' => 'Photon API returns "Great George Street" for "10 Downing St, London, UK" query.',
32
        'testReverseQueryWithNoResults' => 'Photon API returns "Atlas Buoy 0.00E 0.00N" for reverse query at 0,0.',
33
    ];
34
35
    protected function createProvider(HttpClient $httpClient)
36
    {
37
        return Photon::withKomootServer($httpClient, 'Geocoder PHP/Photon Provider/Integration Test');
0 ignored issues
show
Unused Code introduced by
The call to Geocoder\Provider\Photon...ton::withKomootServer() has too many arguments starting with 'Geocoder PHP/Photon Provider/Integration Test'. ( Ignorable by Annotation )

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

37
        return Photon::/** @scrutinizer ignore-call */ withKomootServer($httpClient, 'Geocoder PHP/Photon Provider/Integration Test');

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
38
    }
39
40
    protected function getCacheDir()
41
    {
42
        return __DIR__.'/.cached_responses';
43
    }
44
45
    protected function getApiKey()
46
    {
47
        return null;
48
    }
49
}
50