MockClientStrategy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 14
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCandidates() 0 8 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 3
    public static function getCandidates($type)
20
    {
21 3
        if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) {
22 3
            return [['class' => Mock::class, 'condition' => Mock::class]];
23
        }
24
25
        return [];
26
    }
27
}
28