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

MockClientStrategy::getCandidates()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3.7085

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 4
cts 7
cp 0.5714
rs 9.9332
c 0
b 0
f 0
cc 3
nc 3
nop 1
crap 3.7085
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