Passed
Push — master ( ae6dff...0062d3 )
by Jean-Christophe
09:44
created

PhpHttp   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

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

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.1
11
 *
12
 */
13
class PhpHttp extends AbstractHttp {
14
15 17
	public function getAllHeaders() {
16 17
		return \getallheaders ();
17
	}
18
19 6
	public function header($key, $value, bool $replace = true, int $http_response_code = null) {
20 6
		\header ( $key . ': ' . $value, $replace, $http_response_code );
21 6
	}
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