Fix Exceptions namespaces

This commit is contained in:
Maarten 2019-12-24 00:39:09 +01:00
parent 69c761c3b1
commit df52bab204
23 changed files with 40 additions and 46 deletions

View file

@ -1,5 +1,5 @@
<?php
namespace Runtime\Exceptions;
namespace Runtime\Exceptions\Exceptions;
class ClassNotFoundException extends \BadMethodCallException {}

View file

@ -0,0 +1,5 @@
<?php
namespace Runtime\Exceptions\Exceptions;
class HttpException extends \Exception {}

View file

@ -1,5 +1,5 @@
<?php
namespace Runtime\Exceptions;
namespace Runtime\Exceptions\Exceptions;
class InvalidArgumentException extends \InvalidArgumentException {}

View file

@ -1,5 +1,5 @@
<?php
namespace Runtime\Exceptions;
namespace Runtime\Exceptions\Exceptions;
class MalformedUrlException extends \Exception {}

View file

@ -0,0 +1,5 @@
<?php
namespace Runtime\Exceptions\Exceptions;
class NotFoundHttpException extends HttpException {}

View file

@ -1,5 +1,5 @@
<?php
namespace Runtime\Exceptions;
namespace Runtime\Exceptions\Exceptions;
class SecurityException extends \Exception {}

View file

@ -1,5 +1,5 @@
<?php
namespace Runtime\Exceptions;
namespace Runtime\Exceptions\Exceptions;
class TokenMismatchException extends \Exception {}

View file

@ -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;

View file

@ -2,7 +2,7 @@
namespace Runtime\Http\Input;
use Runtime\Exceptions\InvalidArgumentException;
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
class InputFile implements IInputItem
{

View file

@ -2,7 +2,7 @@
namespace Runtime\Http\Input;
use Runtime\Exceptions\InvalidArgumentException;
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
use Runtime\Http\Request;
class InputHandler

View file

@ -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()
{

View file

@ -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;

View file

@ -2,7 +2,7 @@
namespace Runtime\Http;
use Runtime\Exceptions\InvalidArgumentException;
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
class Response
{

View file

@ -2,7 +2,7 @@
namespace Runtime\Http\Security;
use Runtime\Exceptions\SecurityException;
use Runtime\Exceptions\Exceptions\SecurityException;
class CookieTokenProvider implements ITokenProvider
{

View file

@ -2,7 +2,7 @@
namespace Runtime\Http;
use Runtime\Exceptions\MalformedUrlException;
use Runtime\Exceptions\Exceptions\MalformedUrlException;
class Url implements \JsonSerializable
{

View file

@ -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
{

View file

@ -1,8 +0,0 @@
<?php
namespace Runtime\Router\Exceptions;
class HttpException extends \Exception
{
}

View file

@ -1,8 +0,0 @@
<?php
namespace Runtime\Router\Exceptions;
class NotFoundHttpException extends HttpException
{
}

View file

@ -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
*/

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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
{