mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Development
- Added new Redirect method to SimpleRouter class. - Changed method-names in InputHandler for better description. - Fixed return-types for InputHandler for collections. - Added unit-tests for InputHandler (get, post). - Optimisations.
This commit is contained in:
@@ -506,7 +506,6 @@ class Router
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$this->debug('Start rendering exception handler');
|
||||
$handler->handleError($this->request, $e);
|
||||
$this->debug('Finished rendering exception-handler');
|
||||
@@ -565,7 +564,7 @@ class Router
|
||||
}
|
||||
|
||||
/* Direct match to controller */
|
||||
if ($route instanceof IControllerRoute && strtolower($route->getController()) === strtolower($name)) {
|
||||
if ($route instanceof IControllerRoute && strtoupper($route->getController()) === strtoupper($name)) {
|
||||
$this->debug('Found route "%s" by controller "%s"', $route->getUrl(), $name);
|
||||
|
||||
return $route;
|
||||
@@ -805,26 +804,20 @@ class Router
|
||||
* Set csrf verifier class
|
||||
*
|
||||
* @param BaseCsrfVerifier $csrfVerifier
|
||||
* @return static
|
||||
*/
|
||||
public function setCsrfVerifier(BaseCsrfVerifier $csrfVerifier): self
|
||||
public function setCsrfVerifier(BaseCsrfVerifier $csrfVerifier): void
|
||||
{
|
||||
$this->csrfVerifier = $csrfVerifier;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set class loader
|
||||
*
|
||||
* @param IClassLoader $loader
|
||||
* @return static
|
||||
*/
|
||||
public function setClassLoader(IClassLoader $loader)
|
||||
public function setClassLoader(IClassLoader $loader): void
|
||||
{
|
||||
$this->classLoader = $loader;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -841,13 +834,10 @@ class Router
|
||||
* Register event handler
|
||||
*
|
||||
* @param IEventHandler $handler
|
||||
* @return static
|
||||
*/
|
||||
public function addEventHandler(IEventHandler $handler): self
|
||||
public function addEventHandler(IEventHandler $handler): void
|
||||
{
|
||||
$this->eventHandlers[] = $handler;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user