Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| HttpRequestException | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getStatusValue | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getHttpRequest | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace FileImporter\Exceptions; |
| 4 | |
| 5 | use MWHttpRequest; |
| 6 | use StatusValue; |
| 7 | |
| 8 | /** |
| 9 | * Thrown in cases where a HttpRequest has failed. |
| 10 | * |
| 11 | * @license GPL-2.0-or-later |
| 12 | * @author Addshore |
| 13 | */ |
| 14 | class HttpRequestException extends ImportException { |
| 15 | |
| 16 | public function __construct( |
| 17 | private readonly StatusValue $statusValue, |
| 18 | private readonly MWHttpRequest $httpRequest, |
| 19 | ) { |
| 20 | parent::__construct( (string)$statusValue, $httpRequest->getStatus() ); |
| 21 | } |
| 22 | |
| 23 | public function getStatusValue(): StatusValue { |
| 24 | return $this->statusValue; |
| 25 | } |
| 26 | |
| 27 | public function getHttpRequest(): MWHttpRequest { |
| 28 | return $this->httpRequest; |
| 29 | } |
| 30 | |
| 31 | } |