Passed
Push — master ( 963c04...636654 )
by Jean-Christophe
08:21
created

PhpHttp   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 18
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAllHeaders() 0 2 1
A header() 0 2 1
A headersSent() 0 2 1
A getInput() 0 4 1
1
<?php
2
3
namespace Ubiquity\utils\http\foundation;
4
5
/**
6
 * Ubiquity\utils\http\foundation$PhpHttp
7
 * This class is part of Ubiquity
8
 *
9
 * @author jcheron <[email protected]>
10
 * @version 1.0.0
11
 *
12
 */
13
class PhpHttp extends AbstractHttp {
14
15 19
	public function getAllHeaders() {
16 19
		return \getallheaders ();
17
	}
18
19 2
	public function header($key, $value, $replace = null, $http_response_code = null) {
20 2
		\header ( $key . ': ' . $value, $replace, $http_response_code );
21 2
	}
22
23
	public function headersSent(string &$file = null, int &$line = null) {
24
		return headers_sent ( $file, $line );
25
	}
26
27 1
	public function getInput() {
28 1
		$put = array ();
29 1
		\parse_str ( \file_get_contents ( 'php://input' ), $put );
30 1
		return $put;
31
	}
32
}
33
34