Response   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 37
c 0
b 0
f 0
ccs 8
cts 9
cp 0.8889
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 5 2
A __set() 0 5 2
1
<?php
2
/**
3
 * Copyright (c) Padosoft.com 2016.
4
 */
5
6
namespace Padosoft\HTTPClient;
7
8
/**
9
 * Class Response
10
 * Wrap psr7 Response object wit body and status code.
11
 * @package Padosoft\HTTPClient
12
 */
13
class Response
14
{
15
    /**
16
     * @var int
17
     */
18
    protected $status_code = -1;
19
    /**
20
     * @var string
21
     */
22
    protected $body = '';
23
    /**
24
     * @var \GuzzleHttp\Psr7\Response $psr7response
25
     */
26
    protected $psr7response;
27
28
    /**
29
     * @param $property
30
     * @return mixed
31
     */
32 9
    public function __get($property) {
33 9
        if (property_exists($this, $property)) {
34 9
            return $this->$property;
35
        }
36
    }
37
38
    /**
39
     * @param $property
40
     * @param $value
41
     */
42 9
    public function __set($property, $value) {
43 9
        if (property_exists($this, $property)) {
44 9
            $this->$property = $value;
45 9
        }
46 9
    }
47
48
49
}
50