Completed
Push — master ( 351105...94b286 )
by Joao
02:40
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/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
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.
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/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.
src/RouteHandler.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
     protected $_defaultMethods = [
29 29
         // Service
30
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}/{secondid}.{output}' ],
31
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}.{output}' ],
32
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}/{action}.{output}' ],
33
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}.{output}' ],
34
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}.{output}' ],
35
-        [ "method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}.{output}' ]
30
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}/{secondid}.{output}'],
31
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}/{id:[0-9]+}.{output}'],
32
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}/{action}.{output}'],
33
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{id:[0-9]+}.{output}'],
34
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}/{action}.{output}'],
35
+        ["method" => ['GET', 'POST', 'PUT', 'DELETE'], "pattern" => '/{version}/{module}.{output}']
36 36
     ];
37 37
     protected $_moduleAlias = [];
38 38
     protected $_defaultRestVersion = '1.0';
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      * @param string $version
245 245
      * @param string $routeIndex
246 246
      */
247
-    public static function handleRoute($moduleAlias = [], $routePattern = null, $version = '1.0', $defaultOutput = null ,$routeIndex = "index.php")
247
+    public static function handleRoute($moduleAlias = [], $routePattern = null, $version = '1.0', $defaultOutput = null, $routeIndex = "index.php")
248 248
     {
249 249
         ob_start();
250 250
         session_start();
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
          * you can request only:
264 264
          * http://somehost/module/somealias
265 265
          */
266
-        foreach ((array) $moduleAlias as $alias => $module) {
266
+        foreach ((array)$moduleAlias as $alias => $module) {
267 267
             $route->addModuleAlias($alias, $module);
268 268
         }
269 269
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             && file_exists($_SERVER['SCRIPT_FILENAME'])
307 307
             && basename($_SERVER['SCRIPT_FILENAME']) !== "route.php"
308 308
             && basename($_SERVER['SCRIPT_FILENAME']) !== $routeIndex
309
-        )  {
309
+        ) {
310 310
             $file = $_SERVER['SCRIPT_FILENAME'];
311 311
             if (strpos($file, '.php') !== false) {
312 312
                 require_once($file);
Please login to merge, or discard this patch.