| 1 |
<?php |
| 2 |
/** |
| 3 |
* Driver Interface for analytics platforms |
| 4 |
* |
| 5 |
* @package LinnoSDK\Telemetry |
| 6 |
* @since 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace LinnoSDK\Telemetry\Drivers; |
| 10 |
|
| 11 |
/** |
| 12 |
* Interface DriverInterface |
| 13 |
* |
| 14 |
* Defines the contract for analytics platform drivers. |
| 15 |
* |
| 16 |
* @since 1.0.0 |
| 17 |
*/ |
| 18 |
interface DriverInterface { |
| 19 |
/** |
| 20 |
* Send event data to the analytics platform |
| 21 |
* |
| 22 |
* @param string $event The event name. |
| 23 |
* @param array $properties The event properties. |
| 24 |
* |
| 25 |
* @return bool True on success, false on failure. |
| 26 |
* @since 1.0.0 |
| 27 |
*/ |
| 28 |
public function send( string $event, array $properties ): bool; |
| 29 |
|
| 30 |
/** |
| 31 |
* Set the API key for authentication |
| 32 |
* |
| 33 |
* @param string $apiKey The API key. |
| 34 |
* |
| 35 |
* @return void |
| 36 |
* @since 1.0.0 |
| 37 |
*/ |
| 38 |
public function setApiKey( string $apiKey ): void; |
| 39 |
|
| 40 |
/** |
| 41 |
* Get the last error message |
| 42 |
* |
| 43 |
* @return string|null The last error message or null if no error. |
| 44 |
* @since 1.0.0 |
| 45 |
*/ |
| 46 |
public function getLastError(): ?string; |
| 47 |
} |
| 48 |
|