Fix Exceptions namespaces
This commit is contained in:
parent
69c761c3b1
commit
df52bab204
23 changed files with 40 additions and 46 deletions
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Exceptions;
|
||||
namespace Runtime\Exceptions\Exceptions;
|
||||
|
||||
class ClassNotFoundException extends \BadMethodCallException {}
|
5
src/Runtime/Exceptions/Exceptions/HttpException.php
Normal file
5
src/Runtime/Exceptions/Exceptions/HttpException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Exceptions\Exceptions;
|
||||
|
||||
class HttpException extends \Exception {}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Exceptions;
|
||||
namespace Runtime\Exceptions\Exceptions;
|
||||
|
||||
class InvalidArgumentException extends \InvalidArgumentException {}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Exceptions;
|
||||
namespace Runtime\Exceptions\Exceptions;
|
||||
|
||||
class MalformedUrlException extends \Exception {}
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Exceptions\Exceptions;
|
||||
|
||||
class NotFoundHttpException extends HttpException {}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Exceptions;
|
||||
namespace Runtime\Exceptions\Exceptions;
|
||||
|
||||
class SecurityException extends \Exception {}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Exceptions;
|
||||
namespace Runtime\Exceptions\Exceptions;
|
||||
|
||||
class TokenMismatchException extends \Exception {}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Factory;
|
||||
|
||||
use Runtime\Exceptions\ClassNotFoundException;
|
||||
use Runtime\Exceptions\Exceptions\ClassNotFoundException;
|
||||
use Runtime\Http\View\ViewEngine;
|
||||
use Runtime\Router\Route;
|
||||
use Runtime\Exceptions\ExceptionHandler;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Http\Input;
|
||||
|
||||
use Runtime\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
|
||||
|
||||
class InputFile implements IInputItem
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Http\Input;
|
||||
|
||||
use Runtime\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Http\Request;
|
||||
|
||||
class InputHandler
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Http\Middleware;
|
||||
|
||||
use Runtime\Exceptions\TokenMismatchException;
|
||||
use Runtime\Exceptions\Exceptions\TokenMismatchException;
|
||||
use Runtime\Http\Request;
|
||||
use Runtime\Http\Security\CookieTokenProvider;
|
||||
use Runtime\Http\Security\ITokenProvider;
|
||||
|
@ -17,7 +17,7 @@ class BaseCsrfVerifier implements IMiddleware
|
|||
|
||||
/**
|
||||
* BaseCsrfVerifier constructor.
|
||||
* @throws \Runtime\Exceptions\SecurityException
|
||||
* @throws \Runtime\Exceptions\Exceptions\SecurityException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Http;
|
||||
|
||||
use Runtime\Exceptions\MalformedUrlException;
|
||||
use Runtime\Exceptions\Exceptions\MalformedUrlException;
|
||||
use Runtime\Http\Input\InputHandler;
|
||||
use Runtime\Router\Route\ILoadableRoute;
|
||||
use Runtime\Router\Route\RouteUrl;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Http;
|
||||
|
||||
use Runtime\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
|
||||
|
||||
class Response
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Http\Security;
|
||||
|
||||
use Runtime\Exceptions\SecurityException;
|
||||
use Runtime\Exceptions\Exceptions\SecurityException;
|
||||
|
||||
class CookieTokenProvider implements ITokenProvider
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Runtime\Http;
|
||||
|
||||
use Runtime\Exceptions\MalformedUrlException;
|
||||
use Runtime\Exceptions\Exceptions\MalformedUrlException;
|
||||
|
||||
class Url implements \JsonSerializable
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Runtime\Router\ClassLoader;
|
||||
|
||||
use DI\Container;
|
||||
use Runtime\Router\Exceptions\NotFoundHttpException;
|
||||
use Runtime\Exceptions\Exceptions\NotFoundHttpException;
|
||||
|
||||
class ClassLoader implements IClassLoader
|
||||
{
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Router\Exceptions;
|
||||
|
||||
class HttpException extends \Exception
|
||||
{
|
||||
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Runtime\Router\Exceptions;
|
||||
|
||||
class NotFoundHttpException extends HttpException
|
||||
{
|
||||
|
||||
}
|
|
@ -12,14 +12,14 @@ namespace Runtime\Router;
|
|||
|
||||
use DI\Container;
|
||||
use Runtime\Exceptions\ExceptionHandler;
|
||||
use Runtime\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\MalformedUrlException;
|
||||
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\Exceptions\MalformedUrlException;
|
||||
use Runtime\Http\Middleware\BaseCsrfVerifier;
|
||||
use Runtime\Http\Request;
|
||||
use Runtime\Http\Response;
|
||||
use Runtime\Http\Url;
|
||||
use Runtime\Router\ClassLoader\IClassLoader;
|
||||
use Runtime\Router\Exceptions\HttpException;
|
||||
use Runtime\Exceptions\Exceptions\HttpException;
|
||||
use Runtime\Router\Handlers\CallbackExceptionHandler;
|
||||
use Runtime\Router\Handlers\IEventHandler;
|
||||
use Runtime\Router\Route\IGroupRoute;
|
||||
|
@ -54,8 +54,8 @@ class Route
|
|||
/**
|
||||
* Start routing
|
||||
*
|
||||
* @throws \Runtime\Router\Exceptions\NotFoundHttpException
|
||||
* @throws \Runtime\Exceptions\TokenMismatchException
|
||||
* @throws \Runtime\Exceptions\Exceptions\NotFoundHttpException
|
||||
* @throws \Runtime\Exceptions\Exceptions\TokenMismatchException
|
||||
* @throws HttpException
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
|
|
@ -23,7 +23,7 @@ interface IRoute
|
|||
* @param Request $request
|
||||
* @param Router $router
|
||||
* @return string
|
||||
* @throws \Runtime\Router\Exceptions\NotFoundHttpException
|
||||
* @throws \Runtime\Exceptions\Exceptions\NotFoundHttpException
|
||||
*/
|
||||
public function renderRoute(Request $request, Router $router): ?string;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Runtime\Router\Route;
|
|||
|
||||
use Runtime\Http\Middleware\IMiddleware;
|
||||
use Runtime\Http\Request;
|
||||
use Runtime\Router\Exceptions\HttpException;
|
||||
use Runtime\Exceptions\Exceptions\HttpException;
|
||||
use Runtime\Router\Router;
|
||||
|
||||
abstract class LoadableRoute extends Route implements ILoadableRoute
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Runtime\Router\Route;
|
|||
|
||||
use Runtime\Http\Middleware\IMiddleware;
|
||||
use Runtime\Http\Request;
|
||||
use Runtime\Router\Exceptions\NotFoundHttpException;
|
||||
use Runtime\Exceptions\Exceptions\NotFoundHttpException;
|
||||
use Runtime\Router\Router;
|
||||
|
||||
abstract class Route implements IRoute
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
namespace Runtime\Router;
|
||||
|
||||
use Runtime\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\MalformedUrlException;
|
||||
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\Exceptions\MalformedUrlException;
|
||||
use Runtime\Http\Middleware\BaseCsrfVerifier;
|
||||
use Runtime\Http\Request;
|
||||
use Runtime\Http\Url;
|
||||
use Runtime\Router\ClassLoader\ClassLoader;
|
||||
use Runtime\Router\ClassLoader\IClassLoader;
|
||||
use Runtime\Router\Exceptions\HttpException;
|
||||
use Runtime\Router\Exceptions\NotFoundHttpException;
|
||||
use Runtime\Exceptions\Exceptions\HttpException;
|
||||
use Runtime\Exceptions\Exceptions\NotFoundHttpException;
|
||||
use Runtime\Router\Handlers\EventHandler;
|
||||
use Runtime\Router\Handlers\IEventHandler;
|
||||
use Runtime\Router\Handlers\IExceptionHandler;
|
||||
|
@ -305,8 +305,8 @@ class Router
|
|||
* Start the routing
|
||||
*
|
||||
* @return string|null
|
||||
* @throws \Runtime\Router\Exceptions\NotFoundHttpException
|
||||
* @throws \Runtime\Exceptions\TokenMismatchException
|
||||
* @throws \Runtime\Exceptions\Exceptions\NotFoundHttpException
|
||||
* @throws \Runtime\Exceptions\Exceptions\TokenMismatchException
|
||||
* @throws HttpException
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
@ -625,7 +625,7 @@ class Router
|
|||
* @param array|null $getParams
|
||||
* @return Url
|
||||
* @throws InvalidArgumentException
|
||||
* @throws \Runtime\Exceptions\MalformedUrlException
|
||||
* @throws \Runtime\Exceptions\Exceptions\MalformedUrlException
|
||||
*/
|
||||
public function getUrl(?string $name = null, $parameters = null, ?array $getParams = null): Url
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue