MockClientStrategy::getCandidates()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3.1406

Importance

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