Skip to content

Commit af2abf5

Browse files
committed
rename EndpointRouteHandler
- change the name of EndpointRouteHandler to ControllerRouteHandler
1 parent 9411cdf commit af2abf5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use DevNet\Web\Routing\IRouteHandler;
2020
use DevNet\Web\Routing\RouteContext;
2121

22-
class EndpointRouteHandler implements IRouteHandler
22+
class ControllerRouteHandler implements IRouteHandler
2323
{
2424
use PropertyTrait;
2525

@@ -43,12 +43,12 @@ public function handle(RouteContext $routeContext): Task
4343
$controllerName = $this->target[0];
4444
$actionName = $this->target[1];
4545
if (!class_exists($controllerName)) {
46-
throw new ClassException("Could not find the class {$controllerName}", 404);
46+
throw new ClassException("Could not find the class {$controllerName}");
4747
}
4848

4949
if (!method_exists($controllerName, $actionName)) {
5050
if (!method_exists($controllerName, "async_" . $actionName)) {
51-
throw new MethodException("Call to undefined method {$controllerName}::{$actionName}()", 404);
51+
throw new MethodException("Call to undefined method {$controllerName}::{$actionName}()");
5252
} else {
5353
$actionName = "async_" . $actionName;
5454
}

lib/Endpoint/EndpointRouteBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function mapControllers(?string $area = null, Closure $configure = null)
130130
if ($area) {
131131
$path = '/' . $area . $route->Path;
132132
}
133-
$this->builder->map($path, new EndpointRouteHandler([$className, $method->getName()], $options), $route->Method);
133+
$this->builder->map($path, new ControllerRouteHandler([$className, $method->getName()], $options), $route->Method);
134134
}
135135
}
136136
}

0 commit comments

Comments
 (0)