Passed
Push — master ( 1cb3cc...989b89 )
by Wanderson
02:14 queued 57s
created

Header   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 3
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