File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 11SLACK_API_WEBHOOK = Your_webhook_here
2+
3+ DEFAULT_DATE_TIMEZONE = America/Sao_Paulo
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ date_default_timezone_set (getenv ('DEFAULT_DATE_TIMEZONE ' ));
Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ final class Router implements RouterInterface
1717
1818 public function dispatch (string $ uri , array $ params = []): void
1919 {
20- if (key_exists ($ uri , $ this ->routes )) {
21- $ uriContent = $ this ->routes [$ uri ];
22- $ reflectedControllerMethod = self ::createReflectionMethod ($ uriContent );
23- $ reflectedControllerMethod ->invokeArgs (new $ uriContent ['namespace ' ], $ params );
20+ if (!key_exists ($ uri , $ this ->routes )) {
21+ throw new InvalidArgumentException ("' {$ uri }' is an unregistered route " , StatusCodeEnum::NOT_FOUND ());
2422 }
2523
26- throw new InvalidArgumentException ("' {$ uri }' is an unregistered route " , StatusCodeEnum::NOT_FOUND ());
24+ $ uriContent = $ this ->routes [$ uri ];
25+ $ reflectedControllerMethod = self ::createReflectionMethod ($ uriContent );
26+ $ reflectedControllerMethod ->invokeArgs (new $ uriContent ['namespace ' ], $ params );
2727 }
2828
2929 public function registry (string $ uri , string $ controller , string $ method ): void
Original file line number Diff line number Diff line change 11<?php
22
3- require_once __DIR__ . '/../app/Route/index.php ' ;
4-
53require_once __DIR__ . '/../app/DotEnvLoader/index.php ' ;
4+
5+ require_once __DIR__ . '/../app/Date/index.php ' ;
6+
7+ require_once __DIR__ . '/../app/Route/index.php ' ;
You can’t perform that action at this time.
0 commit comments