Completed
Push — master ( 0728e2...7bf439 )
by Tomas
10:58 queued 10s
created
src/Authorization/CookieApiKeyAuthentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     protected function readAuthorizationToken(): ?string
21 21
     {
22 22
         $apiKey = $_COOKIE[$this->cookieName] ?? null;
23
-        if (!$apiKey) {
23
+        if ( ! $apiKey) {
24 24
             $this->errorMessage = 'API key is not set';
25 25
             return null;
26 26
         }
Please login to merge, or discard this patch.
src/Authorization/BearerTokenAuthorization.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 class BearerTokenAuthorization extends TokenAuthorization
11 11
 {
12
-   /**
12
+    /**
13 13
      * BearerTokenAuthorization constructor.
14 14
      *
15 15
      * @param BearerTokenRepositoryInterface $tokenRepository
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     protected function readAuthorizationToken(): ?string
30 30
     {
31
-        if (!isset($_SERVER['HTTP_AUTHORIZATION'])) {
31
+        if ( ! isset($_SERVER['HTTP_AUTHORIZATION'])) {
32 32
             $this->errorMessage = 'Authorization header HTTP_Authorization is not set';
33 33
             return null;
34 34
         }
Please login to merge, or discard this patch.
src/Authorization/HeaderApiKeyAuthentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Authorization/QueryApiKeyAuthentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Authorization/TokenAuthorization.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Handlers/OpenApiHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $data = [
148 148
             'openapi' => '3.0.0',
149 149
             'info' => [
150
-                'version' => (string)$version,
150
+                'version' => (string) $version,
151 151
                 'title' => 'Nette API',
152 152
             ],
153 153
             'servers' => [
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
             'paths' => $this->getPaths($apis, $baseUrl, $basePath),
207 207
         ];
208 208
 
209
-        if (!$securitySchemes) {
209
+        if ( ! $securitySchemes) {
210 210
             unset($data['components']['securitySchemes']);
211 211
         }
212 212
 
213
-        if (!empty($this->definitions)) {
213
+        if ( ! empty($this->definitions)) {
214 214
             $data['components']['schemas'] = array_merge($this->definitions, $data['components']['schemas']);
215 215
         }
216 216
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
     private function getApis(int $version): array
226 226
     {
227
-        return array_filter($this->apiDecider->getApis(), function (Api $api) use ($version) {
227
+        return array_filter($this->apiDecider->getApis(), function(Api $api) use ($version) {
228 228
             return $version === $api->getEndpoint()->getVersion();
229 229
         });
230 230
     }
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
             }
316 316
 
317 317
             $parameters = $this->createParamsList($handler);
318
-            if (!empty($parameters)) {
318
+            if ( ! empty($parameters)) {
319 319
                 $settings['parameters'] = $parameters;
320 320
             }
321 321
 
322 322
             $requestBody = $this->createRequestBody($handler);
323
-            if (!empty($requestBody)) {
323
+            if ( ! empty($requestBody)) {
324 324
                 $settings['requestBody'] = $requestBody;
325 325
             }
326 326
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
             }
490 490
         }
491 491
 
492
-        if (!empty($postParams['properties'])) {
492
+        if ( ! empty($postParams['properties'])) {
493 493
             $postParamsSchema = [
494 494
                 'type' => 'object',
495 495
                 'properties' => $postParams['properties'],
Please login to merge, or discard this patch.