Completed
Pull Request — master (#61)
by Tomas
03:17
created
src/Component/ApiListingControl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     {
32 32
         $apis = $this->apiDecider->getApis();
33 33
         $this->getTemplate()->add('apis', $this->groupApis($apis));
34
-        $this->getTemplate()->setFile(__DIR__ . '/api_listing.latte');
34
+        $this->getTemplate()->setFile(__DIR__.'/api_listing.latte');
35 35
         $this->getTemplate()->render();
36 36
     }
37 37
 
Please login to merge, or discard this patch.
src/Authorization/BearerTokenAuthorization.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -75,6 +75,7 @@
 block discarded – undo
75 75
      *   '127.0.0.1/32'       - accessible from ip range
76 76
      *   false                - disabled access
77 77
      *
78
+     * @param string|null $ipRestrictions
78 79
      * @return boolean
79 80
      */
80 81
     private function isValidIp(?string $ipRestrictions): bool
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
         list($range, $netmask) = explode('/', $range, 2);
114 114
         $range_decimal = ip2long($range);
115 115
         $ipDecimal = ip2long($ip);
116
-        $wildcard_decimal = pow(2, (32 - (int)$netmask)) - 1;
116
+        $wildcard_decimal = pow(2, (32 - (int) $netmask)) - 1;
117 117
         $netmask_decimal = ~ $wildcard_decimal;
118 118
         return (($ipDecimal & $netmask_decimal) == ($range_decimal & $netmask_decimal));
119 119
     }
Please login to merge, or discard this patch.
src/Component/ApiConsoleControl.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function render(): void
37 37
     {
38
-        $this->getTemplate()->setFile(__DIR__ . '/console.latte');
38
+        $this->getTemplate()->setFile(__DIR__.'/console.latte');
39 39
         $this->getTemplate()->render();
40 40
     }
41 41
 
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
         }
55 55
         $port = '';
56 56
         if ($uri->scheme == 'http' && $uri->port != 80) {
57
-            $port = ':' . $uri->port;
57
+            $port = ':'.$uri->port;
58 58
         }
59
-        $url = $scheme . '://' . $uri->host . $port . '/api/' . $this->endpoint->getUrl();
59
+        $url = $scheme.'://'.$uri->host.$port.'/api/'.$this->endpoint->getUrl();
60 60
 
61 61
         $form->addText('api_url', 'Api Url');
62 62
         $defaults['api_url'] = $url;
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
             for ($i = 0; $i < $count; $i++) {
84 84
                 $key = $param->getKey();
85 85
                 if ($param->isMulti()) {
86
-                    $key = $key . '___' . $i;
86
+                    $key = $key.'___'.$i;
87 87
                 }
88 88
 
89 89
                 if ($param->getAvailableValues() && is_array($param->getAvailableValues())) {
90 90
                     $c = $form->addSelect($key, $this->getParamLabel($param), array_combine($param->getAvailableValues(), $param->getAvailableValues()));
91 91
                     if (!$param->isRequired()) {
92
-                        $c->setPrompt('Select ' . $this->getLabel($param));
92
+                        $c->setPrompt('Select '.$this->getLabel($param));
93 93
                     }
94 94
                 } elseif ($param->getAvailableValues() && is_string($param->getAvailableValues())) {
95 95
                     $c = $form->addText($key, $this->getParamLabel($param))->setDisabled(true);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         if ($param->isRequired()) {
137 137
             $title .= ' *';
138 138
         }
139
-        $title .= ' (' . $param->getType() . ')';
139
+        $title .= ' ('.$param->getType().')';
140 140
         return $title;
141 141
     }
142 142
 
Please login to merge, or discard this patch.
src/Handlers/ApiListingHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      */
54 54
     private function getApiList(int $version): array
55 55
     {
56
-        $versionApis = array_filter($this->apiDecider->getApis(), function (Api $api) use ($version) {
56
+        $versionApis = array_filter($this->apiDecider->getApis(), function(Api $api) use ($version) {
57 57
             return $version == $api->getEndpoint()->getVersion();
58 58
         });
59 59
 
60
-        return array_map(function (Api $api) {
60
+        return array_map(function(Api $api) {
61 61
             return [
62 62
                 'method' => $api->getEndpoint()->getMethod(),
63 63
                 'version' => $api->getEndpoint()->getVersion(),
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     private function createParamsList(ApiHandlerInterface $handler): array
81 81
     {
82
-        return array_map(function (InputParam $param) {
82
+        return array_map(function(InputParam $param) {
83 83
             $parameter = [
84 84
                 'type' => $param->getType(),
85 85
                 'key' => $param->getKey(),
Please login to merge, or discard this patch.
src/Presenters/ApiPresenter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,9 +196,9 @@
 block discarded – undo
196 196
         if (!(isset($refererParsedUrl['scheme']) && isset($refererParsedUrl['host']))) {
197 197
             return null;
198 198
         }
199
-        $url = $refererParsedUrl['scheme'] . '://' . $refererParsedUrl['host'];
199
+        $url = $refererParsedUrl['scheme'].'://'.$refererParsedUrl['host'];
200 200
         if (isset($refererParsedUrl['port']) && $refererParsedUrl['port'] !== 80) {
201
-            $url .= ':' . $refererParsedUrl['port'];
201
+            $url .= ':'.$refererParsedUrl['port'];
202 202
         }
203 203
         return $url;
204 204
     }
Please login to merge, or discard this patch.