Refactored structure
This commit is contained in:
parent
963225382c
commit
e5164ae1dd
329 changed files with 277 additions and 457 deletions
24
src/B8Framework/Exception/HttpException.php
Executable file
24
src/B8Framework/Exception/HttpException.php
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace b8\Exception;
|
||||
|
||||
class HttpException extends \Exception
|
||||
{
|
||||
protected $errorCode = 500;
|
||||
protected $statusMessage = 'Internal Server Error';
|
||||
|
||||
public function getErrorCode()
|
||||
{
|
||||
return $this->errorCode;
|
||||
}
|
||||
|
||||
public function getStatusMessage()
|
||||
{
|
||||
return $this->statusMessage;
|
||||
}
|
||||
|
||||
public function getHttpHeader()
|
||||
{
|
||||
return 'HTTP/1.1 ' . $this->errorCode . ' ' . $this->statusMessage;
|
||||
}
|
||||
}
|
||||
10
src/B8Framework/Exception/HttpException/BadRequestException.php
Executable file
10
src/B8Framework/Exception/HttpException/BadRequestException.php
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace b8\Exception\HttpException;
|
||||
use b8\Exception\HttpException;
|
||||
|
||||
class BadRequestException extends HttpException
|
||||
{
|
||||
protected $errorCode = 400;
|
||||
protected $statusMessage = 'Bad Request';
|
||||
}
|
||||
10
src/B8Framework/Exception/HttpException/ForbiddenException.php
Executable file
10
src/B8Framework/Exception/HttpException/ForbiddenException.php
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace b8\Exception\HttpException;
|
||||
use b8\Exception\HttpException;
|
||||
|
||||
class ForbiddenException extends HttpException
|
||||
{
|
||||
protected $errorCode = 403;
|
||||
protected $statusMessage = 'Forbidden';
|
||||
}
|
||||
10
src/B8Framework/Exception/HttpException/NotAuthorizedException.php
Executable file
10
src/B8Framework/Exception/HttpException/NotAuthorizedException.php
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace b8\Exception\HttpException;
|
||||
use b8\Exception\HttpException;
|
||||
|
||||
class NotAuthorizedException extends HttpException
|
||||
{
|
||||
protected $errorCode = 401;
|
||||
protected $statusMessage = 'Not Authorized';
|
||||
}
|
||||
10
src/B8Framework/Exception/HttpException/NotFoundException.php
Executable file
10
src/B8Framework/Exception/HttpException/NotFoundException.php
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace b8\Exception\HttpException;
|
||||
use b8\Exception\HttpException;
|
||||
|
||||
class NotFoundException extends HttpException
|
||||
{
|
||||
protected $errorCode = 404;
|
||||
protected $statusMessage = 'Not Found';
|
||||
}
|
||||
8
src/B8Framework/Exception/HttpException/ServerErrorException.php
Executable file
8
src/B8Framework/Exception/HttpException/ServerErrorException.php
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace b8\Exception\HttpException;
|
||||
use b8\Exception\HttpException;
|
||||
|
||||
class ServerErrorException extends HttpException
|
||||
{
|
||||
}
|
||||
10
src/B8Framework/Exception/HttpException/ValidationException.php
Executable file
10
src/B8Framework/Exception/HttpException/ValidationException.php
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace b8\Exception\HttpException;
|
||||
use b8\Exception\HttpException;
|
||||
|
||||
class ValidationException extends HttpException
|
||||
{
|
||||
protected $errorCode = 400;
|
||||
protected $statusMessage = 'Bad Request';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue