Completed
Push — master ( 8340dd...9551d2 )
by David
03:35
created

MockClientStrategy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 57.14%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 16
ccs 4
cts 7
cp 0.5714
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCandidates() 0 10 3
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
     */
19 2
    public static function getCandidates($type)
20
    {
21
        switch ($type) {
22 2
            case HttpClient::class:
23 2
            case HttpAsyncClient::class:
24 2
                return [['class' => Mock::class, 'condition' => Mock::class]];
25
            default:
26
                return [];
27
       }
28
    }
29
}
30