Completed
Push — master ( 981a91...dd2c56 )
by Wanderson
01:47
created

Server   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isLocalHost() 0 4 2
A getName() 0 3 1
1
<?php
2
3
namespace Win\Request;
4
5
/**
6
 * Retorna informações do servidor
7
 */
8
class Server {
9
10
	public static function isLocalHost() {
11
		$localAddress = ['localhost', '127.0.0.1', '::1', null];
12
		return (in_array(static::getName(), $localAddress) || strpos(static::getName(), '192.168') !== false);
13
	}
14
15
	/** @return string */
16
	public static function getName() {
17
		return Input::server('SERVER_NAME', FILTER_SANITIZE_STRING);
18
	}
19
20
}
21