-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1) добавлен глобальный обработчик ошибок валидации
2) правки отправки данных 3) мелкие доработки
- Loading branch information
1 parent
f429111
commit 8563591
Showing
5 changed files
with
130 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: viktorthegreat | ||
* Date: 25.02.17 | ||
* Time: 16:53 | ||
*/ | ||
|
||
namespace Requester\Exceptions; | ||
|
||
use Exception; | ||
|
||
class RequesterException extends Exception | ||
{ | ||
public $options = []; | ||
|
||
public function __construct( $message = "", $code = 200, $options = [], Exception $previous = null ) | ||
{ | ||
if ( !empty( $options ) ) | ||
{ | ||
$this->options = $options; | ||
} | ||
|
||
$this->code = $code == 0 ? 400 : $code; | ||
$this->message = $message; | ||
} | ||
|
||
public function getOptions( $option ) | ||
{ | ||
return array_key_exists( $option, $this->options ) ? $this->options[ $option ] : null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: viktorthegreat | ||
* Date: 25.02.17 | ||
* Time: 16:53 | ||
*/ | ||
|
||
namespace Requester\Exceptions; | ||
|
||
class ValidateInputException extends RequesterException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.