@@ -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 |
@@ -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 |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | { |
46 | 46 | try{ |
47 | 47 | foreach ($method->getAttributes() as $attr) { |
48 | - if($attr->getName() != 'HnrAzevedo\Router\Route') continue; |
|
48 | + if($attr->getName() != 'HnrAzevedo\Router\Route') { |
|
49 | + continue; |
|
50 | + } |
|
49 | 51 | |
50 | 52 | $args = $attr->getArguments(); |
51 | 53 | |
@@ -64,7 +66,7 @@ discard block |
||
64 | 66 | ->attrWhere($args) |
65 | 67 | ->attrMiddleware($args); |
66 | 68 | } |
67 | - }catch(Exception $er){ |
|
69 | + } catch(Exception $er){ |
|
68 | 70 | throw new Exception('Failed to add route via attribute: '.$er->getMessage()); |
69 | 71 | } |
70 | 72 | } |