MultiResponse::exec()   B
last analyzed

Complexity

Conditions 5
Paths 12

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 8
nc 12
nop 0
1
<?php
2
/**
3
 * Class MultiResponse
4
 *
5
 * @filesource   MultiResponse.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
/**
16
 *
17
 */
18
class MultiResponse extends ResponseAbstract{
19
20
	/** @inheritdoc */
21
	protected function exec(){
22
		$response = explode("\r\n\r\n", curl_multi_getcontent($this->curl), 2);
23
		$headers = isset($response[0]) ? explode("\r\n", $response[0]) : null;
24
		$this->response_body = isset($response[1]) ? $response[1] : null;
25
		$this->getInfo();
26
27
		if(is_array($headers)){
28
			foreach($headers as $line){
29
				$this->headerLine($this->curl, $line);
30
			}
31
		}
32
33
	}
34
35
}
36