| @@ -5,12 +5,12 @@ | ||
| 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"; | 
| @@ -33,7 +33,7 @@ | ||
| 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 { | 
| @@ -109,8 +109,8 @@ | ||
| 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"; | 
| @@ -34,7 +34,7 @@ | ||
| 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 | |
| @@ -1,8 +1,8 @@ | ||
| 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 | |
| @@ -1,8 +1,8 @@ | ||
| 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 | |
| @@ -101,7 +101,7 @@ | ||
| 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 | |
| @@ -27,12 +27,12 @@ discard block | ||
| 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'; | 
| @@ -263,7 +263,7 @@ discard block | ||
| 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 | |
| @@ -301,7 +301,7 @@ discard block | ||
| 301 | 301 | && file_exists($_SERVER['SCRIPT_FILENAME']) | 
| 302 | 302 | && basename($_SERVER['SCRIPT_FILENAME']) !== "route.php" | 
| 303 | 303 | && basename($_SERVER['SCRIPT_FILENAME']) !== $routeIndex | 
| 304 | -        )  { | |
| 304 | +        ) { | |
| 305 | 305 | $file = $_SERVER['SCRIPT_FILENAME']; | 
| 306 | 306 |              if (strpos($file, '.php') !== false) { | 
| 307 | 307 | require_once($file); |