Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\DataExchange\Infrastructure\Writer; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | /** |
| 12 | * Contract for memory-efficient streaming writers of tabular formats (CSV, XLSX). |
| 13 | * |
| 14 | * @package App\Core\DataExchange\Infrastructure\Writer |
| 15 | */ |
| 16 | interface TabularStreamWriterInterface |
| 17 | { |
| 18 | /** |
| 19 | * Initializes writer and writes column headers. |
| 20 | * |
| 21 | * @param list<string> $headers Column header display titles. |
| 22 | */ |
| 23 | public function writeHeaders(array $headers): void; |
| 24 | |
| 25 | /** |
| 26 | * Streams a single data row to output. |
| 27 | * |
| 28 | * @param list<mixed> $row Ordered data row cells. |
| 29 | */ |
| 30 | public function writeRow(array $row): void; |
| 31 | |
| 32 | /** |
| 33 | * Finalizes file creation and flushes remaining buffers. |
| 34 | */ |
| 35 | public function close(): void; |
| 36 | |
| 37 | /** |
| 38 | * HTTP Content-Type for download response. |
| 39 | */ |
| 40 | public function getMimeType(): string; |
| 41 | |
| 42 | /** |
| 43 | * Canonical file extension (e.g. csv, xlsx). |
| 44 | */ |
| 45 | public function getFileExtension(): string; |
| 46 | } |