| 1 |
<?php |
| 2 |
|
| 3 |
declare (strict_types=1); |
| 4 |
namespace WCPOS\Vendor\Sentry; |
| 5 |
|
| 6 |
use WCPOS\Vendor\Sentry\Integration\IntegrationInterface; |
| 7 |
use WCPOS\Vendor\Sentry\State\Scope; |
| 8 |
use WCPOS\Vendor\Sentry\Transport\Result; |
| 9 |
interface ClientInterface |
| 10 |
{ |
| 11 |
/** |
| 12 |
* Returns the options of the client. |
| 13 |
*/ |
| 14 |
public function getOptions() : Options; |
| 15 |
/** |
| 16 |
* Returns an URL for security policy reporting that's generated from the configured DSN. |
| 17 |
*/ |
| 18 |
public function getCspReportUrl() : ?string; |
| 19 |
/** |
| 20 |
* Logs a message. |
| 21 |
* |
| 22 |
* @param string $message The message (primary description) for the event |
| 23 |
* @param Severity|null $level The level of the message to be sent |
| 24 |
* @param Scope|null $scope An optional scope keeping the state |
| 25 |
* @param EventHint|null $hint Object that can contain additional information about the event |
| 26 |
*/ |
| 27 |
public function captureMessage(string $message, ?Severity $level = null, ?Scope $scope = null, ?EventHint $hint = null) : ?EventId; |
| 28 |
/** |
| 29 |
* Logs an exception. |
| 30 |
* |
| 31 |
* @param \Throwable $exception The exception object |
| 32 |
* @param Scope|null $scope An optional scope keeping the state |
| 33 |
* @param EventHint|null $hint Object that can contain additional information about the event |
| 34 |
*/ |
| 35 |
public function captureException(\Throwable $exception, ?Scope $scope = null, ?EventHint $hint = null) : ?EventId; |
| 36 |
/** |
| 37 |
* Logs the most recent error (obtained with {@link error_get_last}). |
| 38 |
* |
| 39 |
* @param Scope|null $scope An optional scope keeping the state |
| 40 |
* @param EventHint|null $hint Object that can contain additional information about the event |
| 41 |
*/ |
| 42 |
public function captureLastError(?Scope $scope = null, ?EventHint $hint = null) : ?EventId; |
| 43 |
/** |
| 44 |
* Captures a new event using the provided data. |
| 45 |
* |
| 46 |
* @param Event $event The event being captured |
| 47 |
* @param EventHint|null $hint May contain additional information about the event |
| 48 |
* @param Scope|null $scope An optional scope keeping the state |
| 49 |
*/ |
| 50 |
public function captureEvent(Event $event, ?EventHint $hint = null, ?Scope $scope = null) : ?EventId; |
| 51 |
/** |
| 52 |
* Returns the integration instance if it is installed on the client. |
| 53 |
* |
| 54 |
* @param string $className The FQCN of the integration |
| 55 |
* |
| 56 |
* @phpstan-template T of IntegrationInterface |
| 57 |
* |
| 58 |
* @phpstan-param class-string<T> $className |
| 59 |
* |
| 60 |
* @phpstan-return T|null |
| 61 |
*/ |
| 62 |
public function getIntegration(string $className) : ?IntegrationInterface; |
| 63 |
/** |
| 64 |
* Flushes the queue of events pending to be sent. If a timeout is provided |
| 65 |
* and the queue takes longer to drain, the promise resolves with `false`. |
| 66 |
* |
| 67 |
* @param int|null $timeout Maximum time in seconds the client should wait |
| 68 |
*/ |
| 69 |
public function flush(?int $timeout = null) : Result; |
| 70 |
/** |
| 71 |
* Returns the stacktrace builder of the client. |
| 72 |
*/ |
| 73 |
public function getStacktraceBuilder() : StacktraceBuilder; |
| 74 |
} |
| 75 |
|