Completed
Push — master ( 111a2c...05c48e )
by Márk
07:10 queued 04:34
created

UriFactoryDiscovery::find()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 5
loc 5
ccs 2
cts 2
cp 1
rs 9.4286
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Http\Discovery;
4
5
use Http\Message\UriFactory;
6
7
/**
8
 * Finds a URI Factory.
9
 *
10
 * @author David de Boer <[email protected]>
11
 */
12 View Code Duplication
final class UriFactoryDiscovery extends FactoryDiscovery
13
{
14
    /**
15
     * @var UriFactory
16
     */
17
    protected static $cache;
18
19
    /**
20
     * @var array
21
     */
22
    protected static $classes = [
23
        'guzzle' => [
24
            'class' => 'Http\Message\UriFactory\GuzzleUriFactory',
25
            'condition' => [
26
                'Http\Message\UriFactory\GuzzleUriFactory',
27
                'GuzzleHttp\Psr7\Uri',
28
            ],
29
        ],
30
        'diactoros' => [
31
            'class' => 'Http\Message\UriFactory\DiactorosUriFactory',
32
            'condition' => [
33
                'Http\Message\UriFactory\DiactorosUriFactory',
34
                'Zend\Diactoros\Uri',
35
            ],
36
        ],
37
    ];
38
39
    /**
40
     * Finds a URI Factory.
41
     *
42
     * @return UriFactory
43
     */
44 1
    public static function find()
45
    {
46
        // Override only used for return type declaration
47 1
        return parent::find();
48
    }
49
}
50