Passed
Branch master (989b89)
by Wanderson
01:21
created

Header::run()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 4
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Win\Request;
4
5
use Exception;
6
use Win\Data\Data;
7
8
/**
9
 * Header HTTP
10
 */
11
class Header extends Data {
12
13
	/**
14
	 * Enviar por 'HTTP Header' os valores que foram incluídos no Header
15
	 * @throws Exception
16
	 * @codeCoverageIgnore
17
	 */
18
	public function run() {
19
		foreach ($this->all() as $key => $value) {
20
			header($key . ':' . $value);
21
		}
22
		if ($this->get('location')) {
23
			throw new Exception('Redirect fail!');
24
		}
25
	}
26
27
}
28