Response   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A exec() 0 5 1
A __destruct() 0 5 2
1
<?php
2
/**
3
 * Class Response
4
 *
5
 * @filesource   Response.php
6
 * @created      15.02.2016
7
 * @package      chillerlan\TinyCurl
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2016 Smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\TinyCurl;
14
15
class Response extends ResponseAbstract{
16
17
	/** @inheritdoc */
18
	protected function exec(){
19
		curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, [$this, 'headerLine']);
20
		$this->response_body = curl_exec($this->curl);
21
		$this->getInfo();
22
	}
23
24
	/**
25
	 * Farewell.
26
	 *
27
	 * @codeCoverageIgnore
28
	 */
29
	public function __destruct(){
30
		if(is_resource($this->curl)){
31
			curl_close($this->curl);
32
		}
33
	}
34
35
36
}
37