mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
[CLEANUP] Cleaned up code
- Change variable $values to $settings in Route::setSettings method. - Added return types to methods. - Added type to method variables. - Change ClassNotFoundException so required parameters are first.
This commit is contained in:
@@ -16,7 +16,7 @@ class ClassLoader implements IClassLoader
|
||||
public function loadClass(string $class)
|
||||
{
|
||||
if (class_exists($class) === false) {
|
||||
throw new ClassNotFoundHttpException(sprintf('Class "%s" does not exist', $class), 404, null, $class);
|
||||
throw new ClassNotFoundHttpException($class, null, sprintf('Class "%s" does not exist', $class), 404, null);
|
||||
}
|
||||
|
||||
return new $class();
|
||||
@@ -34,4 +34,4 @@ class ClassLoader implements IClassLoader
|
||||
return \call_user_func_array($closure, $parameters);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user