Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 6 |
Exception | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 6 |
__construct ($msg, $code, $req = null) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
getRequest () | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
setRequest ($req) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
<?php | |
/** | |
* @package Moar\Net\Http | |
*/ | |
namespace Moar\Net\Http; | |
/** | |
* Base exception for HTTP request errors. | |
* | |
* @package Moar\Net\Http | |
*/ | |
class Exception extends \RuntimeException { | |
/** | |
* Request that triggered this exception. | |
* @var Request | |
*/ | |
protected $request; | |
/** | |
* Constructor. | |
* @param string $msg Error message | |
* @param int $code Error code | |
* @param Request $req Request that triggered this exception | |
*/ | |
public function __construct ($msg, $code, $req = null) { | |
parent::__construct($msg, $code); | |
$this->request = $req; | |
} | |
/** | |
* Get the request that triggered this exception. | |
* @return Request Request | |
*/ | |
public function getRequest () { | |
return $this->request; | |
} | |
/** | |
* Set the request that triggered this exception. | |
* @param Request $req Request | |
* @return Exception Self, for message chaining | |
*/ | |
public function setRequest ($req) { | |
$this->request = $req; | |
return $this; | |
} | |
} //end Exception |