MultiResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B exec() 0 13 5
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