Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
2 / 2 |
| PineconeException | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| PineconeApiException | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getResponseData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| PineconeAuthException | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| PineconeValidationException | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| PineconeTimeoutException | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Mbvb1223\Pinecone\Errors; |
| 6 | |
| 7 | use Exception; |
| 8 | |
| 9 | class PineconeException extends Exception |
| 10 | { |
| 11 | public function __construct(string $message = '', int $code = 0, ?Exception $previous = null) |
| 12 | { |
| 13 | parent::__construct($message, $code, $previous); |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | class PineconeApiException extends PineconeException |
| 18 | { |
| 19 | private array $responseData; |
| 20 | |
| 21 | public function __construct(string $message, int $statusCode, array $responseData = [], ?Exception $previous = null) |
| 22 | { |
| 23 | $this->responseData = $responseData; |
| 24 | |
| 25 | parent::__construct($message, $statusCode, $previous); |
| 26 | } |
| 27 | |
| 28 | public function getResponseData(): array |
| 29 | { |
| 30 | return $this->responseData; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | class PineconeAuthException extends PineconeException |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | class PineconeValidationException extends PineconeException |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | class PineconeTimeoutException extends PineconeException |
| 43 | { |
| 44 | } |