Completed
Pull Request — master (#137)
by Alessandro
09:35
created

MockClientStrategy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
1
<?php
2
3
namespace Http\Discovery\Strategy;
4
5
use Http\Client\HttpAsyncClient;
6
use Http\Client\HttpClient;
7
use Http\Mock\Client as Mock;
8
9
/**
10
 * Find the Mock client.
11
 *
12
 * @author Sam Rapaport <[email protected]>
13
 */
14
final class MockClientStrategy implements DiscoveryStrategy
15
{
16
    /**
17
     * {@inheritdoc}
18 1
     */
19
    public static function getCandidates($type)
20 1
    {
21 1
        switch ($type) {
22 1
            case HttpClient::class:
23
            case HttpAsyncClient::class:
24
                return [['class' => Mock::class, 'condition' => Mock::class]];
25
            default:
26
                return [];
27
    }
28
}
29
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected EOF, expecting T_FUNCTION or T_CONST
Loading history...