Completed
Push — master ( 942ae8...066784 )
by Joao Gilberto
08:52
created
example.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
 $webRequest = new \ByJG\Util\WebRequest('http://www.byjg.com.br/ws/cep');
6 6
 
7 7
 echo $webRequest->get([
8
-	'httpmethod' => 'obterVersao'
8
+    'httpmethod' => 'obterVersao'
9 9
 ]) . "\n";
10 10
 
11 11
 echo $webRequest->post([
12
-	'httpmethod' => 'obterLogradouro',
13
-	'cep' => '30130000'
12
+    'httpmethod' => 'obterLogradouro',
13
+    'cep' => '30130000'
14 14
 ]) . "\n";
15 15
 
16 16
 echo $webRequest->soapCall('obterLogradouro', ['cep' => '30130000']) . "\n";
Please login to merge, or discard this patch.
src/ResponseBag.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
             $current = XmlUtil::CreateChild($xmlDoc, "root");
34 34
         }
35 35
 
36
-        foreach ((array) $this->collection as $object) {
36
+        foreach ((array)$this->collection as $object) {
37 37
             if ($object instanceof ResponseBag) {
38 38
                 $object->process($current);
39 39
             } else {
Please login to merge, or discard this patch.
src/RouteHandler.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 
22 22
     protected $_defaultMethods = [
23 23
         // Service
24
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}/{secondid}.{output}', "handler" => 'service'],
25
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}.{output}', "handler" => 'service'],
26
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}/{action}.{output}', "handler" => 'service'],
27
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}.{output}', "handler" => 'service'],
28
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}.{output}', "handler" => 'service'],
29
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}.{output}', "handler" => 'service']
24
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}/{secondid}.{output}', "handler" => 'service'],
25
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}.{output}', "handler" => 'service'],
26
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}/{action}.{output}', "handler" => 'service'],
27
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}.{output}', "handler" => 'service'],
28
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}.{output}', "handler" => 'service'],
29
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}.{output}', "handler" => 'service']
30 30
     ];
31 31
     protected $_moduleAlias = [];
32 32
     protected $_defaultVersion = '1.0';
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                     $_REQUEST[$key] = $_GET[$key] = $vars[$key];
133 133
                 }
134 134
 
135
-                return [ $vars['module'], $vars['output']];
135
+                return [$vars['module'], $vars['output']];
136 136
 
137 137
             default:
138 138
                 throw new \Exception('Unknown');
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
          * you can request only:
175 175
          * http://somehost/module/somealias
176 176
          */
177
-        foreach ((array) $moduleAlias as $alias => $module) {
177
+        foreach ((array)$moduleAlias as $alias => $module) {
178 178
             $route->addModuleAlias($alias, $module);
179 179
         }
180 180
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             && file_exists($_SERVER['SCRIPT_FILENAME'])
213 213
             && basename($_SERVER['SCRIPT_FILENAME']) !== "route.php" 
214 214
             && basename($_SERVER['SCRIPT_FILENAME']) !== $routeIndex
215
-        )  {
215
+        ) {
216 216
             $file = $_SERVER['SCRIPT_FILENAME'];
217 217
             if (strpos($file, '.php') !== false) {
218 218
                 require_once($file);
Please login to merge, or discard this patch.
src/ServiceHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@
 block discarded – undo
109 109
                 $array = XmlUtil::xml2Array($dom);
110 110
 
111 111
                 $return = "";
112
-                foreach ((array) $array as $line) {
113
-                    foreach ((array) $line as $field) {
112
+                foreach ((array)$array as $line) {
113
+                    foreach ((array)$line as $field) {
114 114
                         $return .= "\"" . str_replace('"', '\\"', (is_array($field) ? json_encode($field) : $field)) . "\";";
115 115
                     }
116 116
                     $return .= "\n";
Please login to merge, or discard this patch.
src/Whoops/PlainResponseHandler.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Whoops - php errors for cool kids
4
- * @author Filipe Dobreira <http://github.com/filp>
5
- */
3
+     * Whoops - php errors for cool kids
4
+     * @author Filipe Dobreira <http://github.com/filp>
5
+     */
6 6
 
7 7
 namespace ByJG\RestServer\Whoops;
8 8
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
             return $this->returnFrames;
35 35
         }
36 36
 
37
-        $this->returnFrames = (bool) $returnFrames;
37
+        $this->returnFrames = (bool)$returnFrames;
38 38
         return $this;
39 39
     }
40 40
 
Please login to merge, or discard this patch.
src/Whoops/JsonResponseHandler.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Whoops - php errors for cool kids
4
- * @author Filipe Dobreira <http://github.com/filp>
5
- */
3
+     * Whoops - php errors for cool kids
4
+     * @author Filipe Dobreira <http://github.com/filp>
5
+     */
6 6
 
7 7
 namespace ByJG\RestServer\Whoops;
8 8
 
Please login to merge, or discard this patch.
src/HttpResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
             $this->responseDebug = new ResponseBag();
102 102
             $this->response->add($this->responseDebug);
103 103
         }
104
-        $this->responseDebug->add(['debug' => [ $key => $string]]);
104
+        $this->responseDebug->add(['debug' => [$key => $string]]);
105 105
         ErrorHandler::getInstance()->addExtraInfo($key, serialize($string));
106 106
     }
107 107
 
Please login to merge, or discard this patch.