Passed
Pull Request — master (#26)
by Wanderson
02:55
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\Utils;
4
5
/**
6
 * Utilitário de informações do servidor
7
 */
8
abstract class Server
9
{
10
	/** @return bool */
11
	public static function isLocalHost()
12
	{
13
		$localAddress = ['localhost', '127.0.0.1', '::1', '', null];
14
15
		return in_array(static::getName(), $localAddress) || false !== strpos(static::getName(), '192.168');
16
	}
17
18
	/** @return string */
19
	public static function getName()
20
	{
21
		return Input::server('SERVER_NAME', FILTER_SANITIZE_STRING);
22
	}
23
}
24