Completed
Push — develop ( 2c75a2...3f95e8 )
by Adam
08:12
created

DiscoveryTrait::discoverHttpClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace IBM\Watson\Common\Util;
4
5
use Http\Discovery\HttpClientDiscovery;
6
use Http\Discovery\MessageFactoryDiscovery;
7
8
/**
9
 * Utility trait for discovering required components.
10
 */
11
trait DiscoveryTrait
12
{
13
    /**
14
     * Discover configured HTTP client.
15
     *
16
     * @return \Http\Client\HttpClient
17
     */
18
    public function discoverHttpClient()
19
    {
20
        return HttpClientDiscovery::find();
21
    }
22
23
    /**
24
     * Discover configured message factory.
25
     *
26
     * @return \Http\Message\MessageFactory
27
     */
28
    public function discoverMessageFactory()
29
    {
30
        return MessageFactoryDiscovery::find();
31
    }
32
}
33