Completed
Pull Request — master (#56)
by Michal
12:52
created
src/Handlers/ApiListingHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
      */
52 52
     private function getHandlersList($version)
53 53
     {
54
-        $versionHandlers = array_filter($this->apiDecider->getHandlers(), function ($handler) use ($version) {
54
+        $versionHandlers = array_filter($this->apiDecider->getHandlers(), function($handler) use ($version) {
55 55
             return $version == $handler['endpoint']->getVersion();
56 56
         });
57 57
 
58
-        return array_map(function ($handler) {
58
+        return array_map(function($handler) {
59 59
             return [
60 60
                 'method' => $handler['endpoint']->getMethod(),
61 61
                 'version' => $handler['endpoint']->getVersion(),
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     private function createParamsList(ApiHandlerInterface $handler)
79 79
     {
80
-        return array_map(function (InputParam $param) {
80
+        return array_map(function(InputParam $param) {
81 81
             $parameter = [
82 82
                 'type' => $param->getType(),
83 83
                 'key' => $param->getKey(),
Please login to merge, or discard this patch.
src/Component/ApiListingControl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     {
34 34
         $handlers = $this->apiDecider->getHandlers();
35 35
         $this->getTemplate()->add('handlers', $this->sortHandlers($handlers));
36
-        $this->getTemplate()->setFile(__DIR__ . '/api_listing.latte');
36
+        $this->getTemplate()->setFile(__DIR__.'/api_listing.latte');
37 37
         $this->getTemplate()->render();
38 38
     }
39 39
 
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()
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;
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
             for ($i = 0; $i < $count; $i++) {
80 80
                 $key = $param->getKey();
81 81
                 if ($param->isMulti()) {
82
-                    $key = $key . '___' . $i;
82
+                    $key = $key.'___'.$i;
83 83
                 }
84 84
                 
85 85
                 if ($param->getAvailableValues() && is_array($param->getAvailableValues())) {
86 86
                     $c = $form->addSelect($key, $this->getParamLabel($param), array_combine($param->getAvailableValues(), $param->getAvailableValues()));
87 87
                     if (!$param->isRequired()) {
88
-                        $c->setPrompt('Select ' . $this->getLabel($param));
88
+                        $c->setPrompt('Select '.$this->getLabel($param));
89 89
                     }
90 90
                 } elseif ($param->getAvailableValues() && is_string($param->getAvailableValues())) {
91 91
                     $c = $form->addText($key, $this->getParamLabel($param))->setDisabled(true);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         if ($param->isRequired()) {
124 124
             $title .= ' *';
125 125
         }
126
-        $title .= ' (' . $param->getType() . ')';
126
+        $title .= ' ('.$param->getType().')';
127 127
         return $title;
128 128
     }
129 129
 
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
@@ -219,9 +219,9 @@
 block discarded – undo
219 219
         if (!(isset($refererParsedUrl['scheme']) && isset($refererParsedUrl['host']))) {
220 220
             return false;
221 221
         }
222
-        $url = $refererParsedUrl['scheme'] . '://' . $refererParsedUrl['host'];
222
+        $url = $refererParsedUrl['scheme'].'://'.$refererParsedUrl['host'];
223 223
         if (isset($refererParsedUrl['port']) && $refererParsedUrl['port'] !== 80) {
224
-            $url .= ':' . $refererParsedUrl['port'];
224
+            $url .= ':'.$refererParsedUrl['port'];
225 225
         }
226 226
         return $url;
227 227
     }
Please login to merge, or discard this patch.
src/Misc/ConsoleRequest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             foreach ($getFields as $key => $value) {
63 63
                 $parts[] = "$key=$value";
64 64
             }
65
-            $url = $url . '?' . implode('&', $parts);
65
+            $url = $url.'?'.implode('&', $parts);
66 66
         }
67 67
 
68 68
         $putRawPost = null;
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
             foreach ($cookieFields as $key => $value) {
103 103
                 $parts[] = "$key=$value";
104 104
             }
105
-            curl_setopt($curl, CURLOPT_HTTPHEADER, ["Cookie: " . implode('&', $parts)]);
105
+            curl_setopt($curl, CURLOPT_HTTPHEADER, ["Cookie: ".implode('&', $parts)]);
106 106
         }
107 107
 
108 108
         curl_setopt($curl, CURLOPT_TIMEOUT, 30);
109 109
         $headers = [];
110 110
         if ($token !== null && $token !== false) {
111
-            $headers = ['Authorization: Bearer ' . $token];
111
+            $headers = ['Authorization: Bearer '.$token];
112 112
             curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
113 113
         }
114 114
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                 $counter = 0;
247 247
                 foreach ($value as $innerValue) {
248 248
                     if ($innerValue != null) {
249
-                        $result[$key . "[".$counter++."]"] = $innerValue;
249
+                        $result[$key."[".$counter++."]"] = $innerValue;
250 250
                     }
251 251
                 }
252 252
             } else {
Please login to merge, or discard this patch.
src/Params/InputParam.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     const TYPE_FILE      = 'FILE';
13 13
     const TYPE_COOKIE    = 'COOKIE';
14 14
     const TYPE_POST_RAW  = 'POST_RAW';
15
-    const TYPE_POST_JSON_KEY  = 'POST_JSON_KEY';
15
+    const TYPE_POST_JSON_KEY = 'POST_JSON_KEY';
16 16
 
17 17
     const OPTIONAL = false;
18 18
     const REQUIRED = true;
Please login to merge, or discard this patch.
src/Params/JsonInputParam.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 class JsonInputParam extends InputParam
11 11
 {
12
-    const TYPE_POST_JSON  = 'POST_JSON';
12
+    const TYPE_POST_JSON = 'POST_JSON';
13 13
 
14 14
     private $schemaValidator;
15 15
 
Please login to merge, or discard this patch.
src/Handlers/SwaggerHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $handlers = $this->getHandlers($version);
71 71
         $scheme = $this->request->getUrl()->getScheme();
72 72
         $host = $this->request->getUrl()->getHost();
73
-        $baseUrl = $scheme . '://' . $host;
73
+        $baseUrl = $scheme.'://'.$host;
74 74
         $basePath = $this->getBasePath($handlers, $baseUrl);
75 75
 
76 76
         $responses = [
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     private function getHandlers($version)
150 150
     {
151
-        $versionHandlers = array_filter($this->apiDecider->getHandlers(), function ($handler) use ($version) {
151
+        $versionHandlers = array_filter($this->apiDecider->getHandlers(), function($handler) use ($version) {
152 152
             return $version == $handler['endpoint']->getVersion();
153 153
         });
154 154
         return $versionHandlers;
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      */
286 286
     private function createParamsList(ApiHandlerInterface $handler)
287 287
     {
288
-        return array_map(function (InputParam $param) {
288
+        return array_map(function(InputParam $param) {
289 289
             $parameter = [
290 290
                 'name' => $param->getKey(),
291 291
                 'in' => $this->createIn($param->getType()),
Please login to merge, or discard this patch.
src/Handlers/OpenApiHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         $handlers = $this->getHandlers($version);
87 87
         $scheme = $this->request->getUrl()->getScheme();
88 88
         $host = $this->request->getUrl()->getHost();
89
-        $baseUrl = $scheme . '://' . $host;
89
+        $baseUrl = $scheme.'://'.$host;
90 90
         $basePath = $this->getBasePath($handlers, $baseUrl);
91 91
 
92 92
         $responses = [
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             ],
136 136
             'servers' => [
137 137
                 [
138
-                    'url' => $scheme . '://' . $host . $basePath,
138
+                    'url' => $scheme.'://'.$host.$basePath,
139 139
                 ],
140 140
             ],
141 141
             'components' => [
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     private function getHandlers($version)
214 214
     {
215
-        $versionHandlers = array_filter($this->apiDecider->getHandlers(), function ($handler) use ($version) {
215
+        $versionHandlers = array_filter($this->apiDecider->getHandlers(), function($handler) use ($version) {
216 216
             return $version == $handler['endpoint']->getVersion();
217 217
         });
218 218
         return $versionHandlers;
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     private function addDefinition($name, $definition)
430 430
     {
431 431
         if (isset($this->definitions[$name])) {
432
-            throw new InvalidArgumentException('Definition with name ' . $name . ' already exists. Rename it or use existing one.');
432
+            throw new InvalidArgumentException('Definition with name '.$name.' already exists. Rename it or use existing one.');
433 433
         }
434 434
         $this->definitions[$name] = $definition;
435 435
     }
Please login to merge, or discard this patch.