Differences Between: [Versions 402 and 403]
1 <?php 2 3 declare(strict_types=1); 4 5 namespace OpenSpout\Writer; 6 7 use OpenSpout\Common\Entity\Row; 8 9 interface WriterInterface 10 { 11 /** 12 * Initializes the writer and opens it to accept data. 13 * By using this method, the data will be written to a file. 14 * 15 * @param string $outputFilePath Path of the output file that will contain the data 16 * 17 * @throws \OpenSpout\Common\Exception\IOException If the writer cannot be opened or if the given path is not writable 18 */ 19 public function openToFile(string $outputFilePath): void; 20 21 /** 22 * Initializes the writer and opens it to accept data. 23 * By using this method, the data will be outputted directly to the browser. 24 * 25 * @param string $outputFileName Name of the output file that will contain the data. If a path is passed in, only the file name will be kept 26 * 27 * @throws \OpenSpout\Common\Exception\IOException If the writer cannot be opened 28 */ 29 public function openToBrowser(string $outputFileName): void; 30 31 /** 32 * Appends a row to the end of the stream. 33 * 34 * @param Row $row The row to be appended to the stream 35 * 36 * @throws \OpenSpout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet 37 * @throws \OpenSpout\Common\Exception\IOException If unable to write data 38 */ 39 public function addRow(Row $row): void; 40 41 /** 42 * Appends the rows to the end of the stream. 43 * 44 * @param Row[] $rows The rows to be appended to the stream 45 * 46 * @throws \OpenSpout\Common\Exception\InvalidArgumentException If the input param is not valid 47 * @throws \OpenSpout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet 48 * @throws \OpenSpout\Common\Exception\IOException If unable to write data 49 */ 50 public function addRows(array $rows): void; 51 52 /** 53 * Set document creator. 54 * 55 * @param string $creator document creator 56 */ 57 public function setCreator(string $creator): void; 58 59 /** 60 * @return 0|positive-int 61 */ 62 public function getWrittenRowCount(): int; 63 64 /** 65 * Closes the writer. This will close the streamer as well, preventing new data 66 * to be written to the file. 67 */ 68 public function close(): void; 69 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body