@@ -25,7 +25,7 @@ |
||
25 | 25 | * Get Header |
26 | 26 | * |
27 | 27 | * @return string |
28 | - */ |
|
28 | + */ |
|
29 | 29 | public function getHeader() |
30 | 30 | { |
31 | 31 | return 'Content-Type: application/xml'; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | foreach ($array as $key => $value) { |
37 | 37 | if (is_numeric($key)) { |
38 | - $key = 'item' . $key; |
|
38 | + $key = 'item'.$key; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | if (is_array($value)) { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $process = @popen('wmic cpu get NumberOfCores', 'rb'); |
32 | 32 | if (false !== $process) { |
33 | 33 | fgets($process); |
34 | - $cores= intval(fgets($process)); |
|
34 | + $cores = intval(fgets($process)); |
|
35 | 35 | pclose($process); |
36 | 36 | return $cores; |
37 | 37 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | private function prepareRouteInfo($routeInfo) |
27 | 27 | { |
28 | - isset($routeInfo[1]['method']) || $routeInfo[1]['method'] = null; |
|
28 | + isset($routeInfo[1]['method']) || $routeInfo[1]['method'] = null; |
|
29 | 29 | isset($routeInfo[1]['controller']) || $routeInfo[1]['controller'] = null; |
30 | 30 | isset($routeInfo[2]) || $routeInfo[2] = []; |
31 | 31 | isset($routeInfo[2]['format']) || $routeInfo[2]['format'] = 'json'; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | require_once __DIR__.("/../../vendor/autoload.php"); |
6 | 6 | |
7 | 7 | $dispatcher = FastRoute\simpleDispatcher( |
8 | - function (FastRoute\RouteCollector $r) { |
|
8 | + function(FastRoute\RouteCollector $r) { |
|
9 | 9 | $r->addRoute( |
10 | 10 | 'GET', |
11 | 11 | '/serverinfo/{format}[/{pingHostname:[[:alnum:].]+}]', |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * Get Header |
26 | 26 | * |
27 | 27 | * @return string |
28 | - */ |
|
28 | + */ |
|
29 | 29 | public function getHeader() |
30 | 30 | { |
31 | 31 | return 'Content-Type: application/xml'; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | if (json_last_error() !== JSON_ERROR_NONE) { |
46 | 46 | throw new \Exception('Can\'t parse config'); |
47 | 47 | } |
48 | - return (array) $decodedData; |
|
48 | + return (array)$decodedData; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | private function isFileReadable($fullPath) |
56 | 56 | { |
57 | - if ( ! is_readable($fullPath)) { |
|
57 | + if (!is_readable($fullPath)) { |
|
58 | 58 | throw new \Exception('config is not readable'); |
59 | 59 | } |
60 | 60 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | { |
8 | 8 | public function build($name) |
9 | 9 | { |
10 | - if ( ! class_exists($name)) { |
|
10 | + if (!class_exists($name)) { |
|
11 | 11 | throw new ControllerException($name.' class not found.'); |
12 | 12 | } |
13 | 13 | return new $name; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | is_null($pingHostname) ? $config->hostToPing = $config->defaultHostToPing : $config->hostToPing = $pingHostname; |
17 | 17 | $this->addModules($container->get('ModuleFacade'), $config); |
18 | 18 | $renderData = $container->get('ModuleFacade')->returnModulesData(); |
19 | - if ( ! $this->canUserPassWhiteList($_SERVER['SERVER_ADDR'], $config)) { |
|
19 | + if (!$this->canUserPassWhiteList($_SERVER['SERVER_ADDR'], $config)) { |
|
20 | 20 | $renderData = ['error' => 'Your ip is not on whitelist.']; |
21 | 21 | } |
22 | 22 | echo $this->renderFormat( |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | private function canUserPassWhiteList($clientIp, Config $config) |
31 | 31 | { |
32 | 32 | if ($config->whitelistEnabled) { |
33 | - if ( ! in_array($clientIp, $config->whitelist)) { |
|
33 | + if (!in_array($clientIp, $config->whitelist)) { |
|
34 | 34 | return false; |
35 | 35 | } |
36 | 36 | } |
@@ -13,8 +13,8 @@ |
||
13 | 13 | |
14 | 14 | public function createFormat($type) |
15 | 15 | { |
16 | - if ( ! array_key_exists($type, $this->types) |
|
17 | - || ! class_exists($this->types[$type]) |
|
16 | + if (!array_key_exists($type, $this->types) |
|
17 | + || !class_exists($this->types[$type]) |
|
18 | 18 | ) { |
19 | 19 | throw new ApiException('Format Type: '.$type.' not found.'); |
20 | 20 | } |