| 1 |
<?php |
| 2 |
/** |
| 3 |
* Log File Interface |
| 4 |
* |
| 5 |
* @package SeQura/WC |
| 6 |
* @subpackage SeQura/WC/Services |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace SeQura\WC\Services; |
| 10 |
|
| 11 |
/** |
| 12 |
* Provides methods to perform read and write operations on a log file. |
| 13 |
*/ |
| 14 |
interface Interface_Log_File { |
| 15 |
|
| 16 |
/** |
| 17 |
* Append content at the end of the log file. |
| 18 |
* |
| 19 |
* @param string $content The content to append. |
| 20 |
* @throws \Exception If something goes wrong. The exception message will contain the error message. |
| 21 |
*/ |
| 22 |
public function append_content( $content ): void; |
| 23 |
|
| 24 |
/** |
| 25 |
* Get the content of the log file. |
| 26 |
* |
| 27 |
* @param string $store_id The store ID. |
| 28 |
* @throws \Exception If something goes wrong. The exception message will contain the error message. |
| 29 |
* |
| 30 |
* @return string[] Each element is a line of the log file. |
| 31 |
*/ |
| 32 |
public function get_content( $store_id ): array; |
| 33 |
|
| 34 |
/** |
| 35 |
* Clear the log file. |
| 36 |
* |
| 37 |
* @param string $store_id The store ID. |
| 38 |
* @throws \Exception If something goes wrong. The exception message will contain the error message. |
| 39 |
*/ |
| 40 |
public function clear( $store_id = null ): void; |
| 41 |
|
| 42 |
/** |
| 43 |
* Make sure the log file exists and is writable. |
| 44 |
*/ |
| 45 |
public function setup(): bool; |
| 46 |
} |
| 47 |
|