Skip to content

Commit 52867a7

Browse files
author
Alistair Kearney
committed
Updated core controller event based on changes to ControllerNotFoundException and MethodNotAllowedException
1 parent fe56976 commit 52867a7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

events/event.controller.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static function about()
1616
'email' => 'hi@alistairkearney.com'
1717
],
1818
'version' => 'Symphony 2.6.7',
19-
'release-date' => '2016-04-25T02:10:22+00:00',
19+
'release-date' => '2016-06-16',
2020
'trigger-condition' => 'POST|PUT|PATCH|DELETE'
2121
];
2222
}
@@ -54,7 +54,7 @@ public function load()
5454
// #6 - Check if the controller exists before trying to include it.
5555
// Throw an exception if it cannot be located.
5656
if(!class_exists($controllerPath)) {
57-
throw new Lib\Exceptions\ControllerNotFoundException("Controller '{$controllerPath}' does not exist.");
57+
throw new Lib\Exceptions\ControllerNotFoundException($controllerPath);
5858
}
5959

6060
$controller = new $controllerPath();
@@ -67,7 +67,7 @@ public function load()
6767
$method = strtolower($request->getMethod());
6868

6969
if(!method_exists($controller, $method)){
70-
throw new Lib\Exceptions\ControllerNotValidException("405 method not found (".$request->getMethod().")");
70+
throw new Lib\Exceptions\MethodNotAllowedException($request->getMethod());
7171
}
7272

7373
$controller->execute();

0 commit comments

Comments
 (0)