@@ -21,7 +21,7 @@ |
||
21 | 21 | { |
22 | 22 | $headerName = 'HTTP_' . strtoupper(str_replace('-', '_', $this->headerName)); |
23 | 23 | $apiKey = $_SERVER[$headerName] ?? null; |
24 | - if (!$apiKey) { |
|
24 | + if ( ! $apiKey) { |
|
25 | 25 | $this->errorMessage = 'API key is not set'; |
26 | 26 | return null; |
27 | 27 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | protected function readAuthorizationToken(): ?string |
21 | 21 | { |
22 | 22 | $apiKey = $_GET[$this->queryParamName] ?? null; |
23 | - if (!$apiKey) { |
|
23 | + if ( ! $apiKey) { |
|
24 | 24 | $this->errorMessage = 'API key is not set'; |
25 | 25 | return null; |
26 | 26 | } |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $result = $this->tokenRepository->validToken($token); |
49 | - if (!$result) { |
|
49 | + if ( ! $result) { |
|
50 | 50 | $this->errorMessage = 'Token doesn\'t exists or isn\'t active'; |
51 | 51 | return false; |
52 | 52 | } |
53 | 53 | |
54 | - if (!$this->isValidIp($this->tokenRepository->ipRestrictions($token))) { |
|
54 | + if ( ! $this->isValidIp($this->tokenRepository->ipRestrictions($token))) { |
|
55 | 55 | $this->errorMessage = 'Invalid IP'; |
56 | 56 | return false; |
57 | 57 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | list($range, $netmask) = explode('/', $range, 2); |
115 | 115 | $range_decimal = ip2long($range); |
116 | 116 | $ipDecimal = ip2long($ip); |
117 | - $wildcard_decimal = pow(2, (32 - (int)$netmask)) - 1; |
|
117 | + $wildcard_decimal = pow(2, (32 - (int) $netmask)) - 1; |
|
118 | 118 | $netmask_decimal = ~ $wildcard_decimal; |
119 | 119 | return (($ipDecimal & $netmask_decimal) === ($range_decimal & $netmask_decimal)); |
120 | 120 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | if (count($args) < 3) { |
29 | 29 | $message = "Invalid link destination, too few arguments."; |
30 | - if (!Debugger::$productionMode) { |
|
30 | + if ( ! Debugger::$productionMode) { |
|
31 | 31 | throw new InvalidLinkException($message); |
32 | 32 | } |
33 | 33 | Debugger::log($message, Debugger::EXCEPTION); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | |
45 | 45 | return $writer->write('echo ($presenter->context->getByType("' . ApiLink::class . '"))' . |
46 | 46 | '->link((new Tomaj\NetteApi\EndpointIdentifier(' . |
47 | - $arguments['method'] . ', ' . |
|
48 | - $arguments['version'] . ', ' . |
|
47 | + $arguments['method'] . ', ' . |
|
48 | + $arguments['version'] . ', ' . |
|
49 | 49 | $arguments['package'] . ', ' . |
50 | 50 | $arguments['action'] . ')), ' . $arguments['params'] . ')'); |
51 | 51 | } |