Completed
Branch master (e874e7)
by smiley
05:21
created

Response   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 24
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
	/**
18
	 * Fills self::$response_body and calls self::getInfo()
19
	 */
20
	protected function exec(){
21
		curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, [$this, 'headerLine']);
22
		$this->response_body = curl_exec($this->curl);
23
		$this->getInfo();
24
	}
25
26
	/**
27
	 * Farewell.
28
	 *
29
	 * @codeCoverageIgnore
30
	 */
31
	public function __destruct(){
32
		if(is_resource($this->curl)){
33
			curl_close($this->curl);
34
		}
35
	}
36
37
38
}
39