HttpInteraction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 33
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 4 1
A setUp() 0 7 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: cesinha
5
 * Date: 31/07/17
6
 * Time: 08:15
7
 */
8
9
namespace Preetender\Routing\Testing;
10
use GuzzleHttp\Client;
11
use Psr\Http\Message\ResponseInterface;
12
13
/**
14
 * Trait HttpInteraction
15
 * @package Preetender\Routing\Testing
16
 */
17
trait HttpInteraction
18
{
19
    /** @var string  */
20
    protected $baseUrl = 'http://routing_v1_2.app';
21
22
    /** @var float  */
23
    protected $timeout = 2.0;
24
25
    /** @var Client */
26
    protected $http;
27
28
    /**
29
     * @param ResponseInterface $response
30
     * @return ResponseInterface
31
     */
32
    protected function getResponse(ResponseInterface $response)
33
    {
34
        return $response;
35
    }
36
37
    /**
38
     * ....
39
     *
40
     * @inheritdoc
41
     */
42
    public function setUp()
43
    {
44
        $this->http = new Client([
45
            'base_uri' => $this->baseUrl,
46
            'timeout' => $this->timeout
47
        ]);
48
    }
49
}