nozavroni / csvelte

🕺🏻 CSV and Tabular Data library for PHP
http://phpcsv.com/
Other
6 stars 0 forks source link

Streamable interface #107

Closed nozavroni closed 7 years ago

nozavroni commented 7 years ago

Rather than have three interfaces that will never be used separately, how about reducing it down to one simple interface called CSVelte\Contract\Streamable. If a class implements that sucker, it can be passed to the reader, the writer, the taster... whatever you want. OK make it happen...

I haven't had a chance to really read up on what exactly PSR-7 is supposed to be, but I did notice that it has a StreamInterface that, I believe, my stream class wouldn't require any changes to implement. Look into it.

http://www.php-fig.org/psr/psr-7/

The only methods specified by StreamInterface that I don't have are tell, getSize, detach, and __toString(). Everything else is identical.

Also of interest is the PSR-17 "HTTP Factories" interface StreamFactoryInterface

https://github.com/php-fig/fig-standards/blob/master/proposed/http-factory/http-factory.md

nozavroni commented 7 years ago

Closing all issues that only need documentation.