Passed
Push — master ( c4282d...8835f1 )
by Jean-Christophe
10:25
created

PhpHttp::getInput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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 13
	public function getAllHeaders() {
16 13
		return \getallheaders ();
17
	}
18
19 2
	public function header($key, $value, bool $replace = true, int $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
	public function getInput() {
28
		$put = array ();
29
		\parse_str ( \file_get_contents ( 'php://input' ), $put );
30
		return $put;
31
	}
32
}
33
34