1 | <?php |
||
29 | trait IsWritable |
||
30 | { |
||
31 | /** |
||
32 | * Write single line to file/stream |
||
33 | * |
||
34 | * Writes a line to the file/stream (if it is writable) |
||
35 | * |
||
36 | * @param string $line The line to be written to the stream |
||
37 | * @param string $eol The end of line string |
||
38 | * @return int The number of bytes written to the stream |
||
39 | * @throws CSVelte\Exception\IOException |
||
40 | */ |
||
41 | 12 | public function writeLine($line, $eol = PHP_EOL) |
|
45 | |||
46 | /** |
||
47 | * Assert that this file/stream object is readable. |
||
48 | * |
||
49 | * @return void |
||
50 | * @throws CSVelte\Exception\IOException if stream isn't readable |
||
51 | */ |
||
52 | 13 | protected function assertIsWritable() |
|
58 | |||
59 | abstract public function getName(); |
||
60 | |||
61 | abstract public function isWritable(); |
||
62 | |||
63 | abstract public function write($str); |
||
64 | |||
65 | } |
||
66 |