@@ -77,7 +77,7 @@ |
||
| 77 | 77 | |
| 78 | 78 | runMiddlewares($serverRequest); |
| 79 | 79 | |
| 80 | -}catch(Exception $er){ |
|
| 80 | +} catch(Exception $er){ |
|
| 81 | 81 | |
| 82 | 82 | die("Code Error: {$er->getCode()}<br>Line: {$er->getLine()}<br>File: {$er->getFile()}<br>Message: {$er->getMessage()}."); |
| 83 | 83 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | $action = Router::currentAction(); |
| 30 | 30 | |
| 31 | -}catch(Exception $er){ |
|
| 31 | +} catch(Exception $er){ |
|
| 32 | 32 | |
| 33 | 33 | die("Code Error: {$er->getCode()}<br>Line: {$er->getLine()}<br>File: {$er->getFile()}<br>Message: {$er->getMessage()}."); |
| 34 | 34 | |
@@ -93,7 +93,9 @@ discard block |
||
| 93 | 93 | $ReflectionMethod = new \ReflectionFunction($closure); |
| 94 | 94 | |
| 95 | 95 | foreach($ReflectionMethod->getParameters() as $param){ |
| 96 | - if(!isset($_REQUEST[$param->name])) continue; |
|
| 96 | + if(!isset($_REQUEST[$param->name])) { |
|
| 97 | + continue; |
|
| 98 | + } |
|
| 97 | 99 | $params[$param->name] = $_REQUEST[$param->name]; |
| 98 | 100 | } |
| 99 | 101 | |
@@ -176,7 +178,9 @@ discard block |
||
| 176 | 178 | $ReflectionMethod = new \ReflectionMethod(new $controller(), $method); |
| 177 | 179 | |
| 178 | 180 | foreach($ReflectionMethod->getParameters() as $param){ |
| 179 | - if(!isset($_REQUEST[$param->name])) continue; |
|
| 181 | + if(!isset($_REQUEST[$param->name])) { |
|
| 182 | + continue; |
|
| 183 | + } |
|
| 180 | 184 | $params[$param->name] = $_REQUEST[$param->name]; |
| 181 | 185 | } |
| 182 | 186 | |
@@ -35,7 +35,9 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | try{ |
| 37 | 37 | foreach ($method->getAttributes() as $attr) { |
| 38 | - if($attr->getName() != 'HnrAzevedo\Router\RouteAttribute') continue; |
|
| 38 | + if($attr->getName() != 'HnrAzevedo\Router\RouteAttribute') { |
|
| 39 | + continue; |
|
| 40 | + } |
|
| 39 | 41 | |
| 40 | 42 | $args = $attr->getArguments(); |
| 41 | 43 | |
@@ -54,7 +56,7 @@ discard block |
||
| 54 | 56 | ->attrWhere($args) |
| 55 | 57 | ->attrMiddleware($args); |
| 56 | 58 | } |
| 57 | - }catch(Exception $er){ |
|
| 59 | + } catch(Exception $er){ |
|
| 58 | 60 | throw new Exception('Failed to add route via attribute: '.$er->getMessage()); |
| 59 | 61 | } |
| 60 | 62 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | self::getInstance()->checkMethod($route, $requestMethod); |
| 100 | 100 | self::getInstance()->checkData($route, (new Uri($_SERVER['REQUEST_URI']))->getPath()); |
| 101 | 101 | return self::getInstance(); |
| 102 | - }catch(\Exception $er){ |
|
| 102 | + } catch(\Exception $er){ |
|
| 103 | 103 | continue; |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | try{ |
| 127 | 127 | $action = unserialize(self::getInstance()->current()['action']); |
| 128 | 128 | self::getInstance()->executeRouteAction((is_string($action)) ? $action : $action->getClosure()); |
| 129 | - }catch(\Exception $er){ |
|
| 129 | + } catch(\Exception $er){ |
|
| 130 | 130 | self::getInstance()->error = $er; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | $action = Router::currentAction(); |
| 37 | 37 | |
| 38 | -}catch(Exception $er){ |
|
| 38 | +} catch(Exception $er){ |
|
| 39 | 39 | |
| 40 | 40 | die("Code Error: {$er->getCode()}".PHP_EOL."Line: {$er->getLine()}".PHP_EOL."File: {$er->getFile()}".PHP_EOL."Message: {$er->getMessage()}."); |
| 41 | 41 | |