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

Response::exec()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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