Completed
Pull Request — master (#61)
by Michal
03:22
created
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/Response/JsonApiResponse.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,6 @@
 block discarded – undo
32 32
      * to setup response code, content type, charset and expiration
33 33
      *
34 34
      * @param integer $code
35
-     * @param mixed $data
36 35
      * @param string $contentType
37 36
      * @param string $charset
38 37
      * @param bool|DateTimeInterface|int|string $expiration
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
@@ -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/Handlers/ApiListingHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
      */
53 53
     private function getApiList($version)
54 54
     {
55
-        $versionApis = array_filter($this->apiDecider->getApis(), function (Api $api) use ($version) {
55
+        $versionApis = array_filter($this->apiDecider->getApis(), function(Api $api) use ($version) {
56 56
             return $version == $api->getEndpoint()->getVersion();
57 57
         });
58 58
 
59
-        return array_map(function (Api $api) {
59
+        return array_map(function(Api $api) {
60 60
             return [
61 61
                 'method' => $api->getEndpoint()->getMethod(),
62 62
                 'version' => $api->getEndpoint()->getVersion(),
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     private function createParamsList(ApiHandlerInterface $handler)
80 80
     {
81
-        return array_map(function (InputParam $param) {
81
+        return array_map(function(InputParam $param) {
82 82
             $parameter = [
83 83
                 'type' => $param->getType(),
84 84
                 'key' => $param->getKey(),
Please login to merge, or discard this patch.