Passed
Push — master ( b9a31e...494505 )
by Wanderson
02:11
created

Server::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Win\Common;
4
5
use Win\Common\Utils\Input;
6
7
/**
8
 * Retorna informações do servidor
9
 */
10
abstract class Server
11
{
12
	/** @return bool */
13
	public static function isLocalHost()
14
	{
15
		$localAddress = ['localhost', '127.0.0.1', '::1', '', null];
16
17
		return in_array(static::getName(), $localAddress) || false !== strpos(static::getName(), '192.168');
18
	}
19
20
	/** @return string */
21
	public static function getName()
22
	{
23
		return Input::server('SERVER_NAME', FILTER_SANITIZE_STRING);
24
	}
25
}
26