Completed
Pull Request — master (#65)
by Tobias
03:21
created

EmulateAsyncClientStrategy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCandidates() 0 15 2
1
<?php
2
3
namespace Http\Discovery\Strategy;
4
5
use Http\Adapter\Guzzle6\Client as Guzzle6;
6
use Http\Adapter\Guzzle5\Client as Guzzle5;
7
use Http\Client\Common\EmulatedHttpAsyncClient;
8
use Http\Client\Curl\Client as Curl;
9
use Http\Client\Socket\Client as Socket;
10
use Http\Adapter\React\Client as React;
11
use Http\Adapter\Buzz\Client as Buzz;
12
13
/**
14
 * @internal
15
 *
16
 * @author Tobias Nyholm <[email protected]>
17
 */
18
final class EmulateAsyncClientStrategy implements DiscoveryStrategy
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public static function getCandidates($type)
24
    {
25
        if ($type === 'Http\Client\HttpAsyncClient') {
26
            return [
27
            //     ['class' => Guzzle6::class, 'condition' => Guzzle6::class],
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
28
            //     ['class' => Curl::class, 'condition' => Curl::class],
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
29
            //     ['class' => React::class, 'condition' => React::class],
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
30
                ['class' => function() { return new EmulatedHttpAsyncClient(new Guzzle5()); }, 'condition' => Guzzle5::class],
31
                ['class' => function() { return new EmulatedHttpAsyncClient(new Socket()); }, 'condition' => Socket::class],
32
                ['class' => function() { return new EmulatedHttpAsyncClient(new Buzz()); }, 'condition' => Buzz::class],
33
            ];
34
        }
35
36
        return [];
37
    }
38
}
39