Created
June 27, 2019 11:41
-
-
Save kolomiec-valeriy/b1d150cbf57069ed579d60b8f1b69639 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace App\Exception; | |
use Symfony\Component\HttpKernel\Exception\HttpException; | |
class JsonHttpException extends HttpException | |
{ | |
private $data; | |
/** | |
* @param int $statusCode | |
* @param string $message | |
* @param mixed $data | |
*/ | |
public function __construct($statusCode, $message = null, $data = null) | |
{ | |
parent::__construct($statusCode, $message); | |
$this->setData($data); | |
} | |
/** | |
* @return mixed | |
*/ | |
public function getData() | |
{ | |
return $this->data; | |
} | |
/** | |
* @param mixed $data | |
*/ | |
public function setData($data) | |
{ | |
$this->data = $data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment