@@ -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'; |
@@ -244,7 +244,7 @@ discard block |
||
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 |
||
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 |
||
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); |