Throw StreamUnusableException after close/detach
This commit adjusts the behavior of close and detach to set the body
to null rather than an empty string. All methods that support throwing
an exception will now throw StreamUnusableException to indicate the
stream has been closed and is thus unusable.
The methods that do not have "@throws RuntimeException" in their
docblocks usually return the zero value of their type. The sole
exception is the eof (End of File) function, since both true and false
is wrong; there's no stream to be at the end of. In this case, true is
returned because that's how the existing implementation works; pointer
is at payload length.
StreamUnusableException is a kind of IllegalOperationException, a new
exception that tells upstream callers which function call failed and
why. ReadOnlyStringStream now throws IllegalOperationException when a
user calls the write() method.
This commit introduces a Read Only version of StringStream
Fix write() to not prepend
This commit brings write() more inline with how fwrite() works, given
that's ultimately what StreamInterface is trying to provide; a wrapper
around streams and the various file functions
It's still possible to append by writing beyond the capacity of the
Attempt to build on PHP 7.4 and 8.0
8.0 is going to fail at `composer install', however 7.4 might make it
all the way to the end. Once 7.4 is out, this build can be marked as
Fix write() to not assume appending is correct
This commit rewrites the `write()' function to check if it's at EOF
before appending. Now the function is able to prepend if at SOF, and
can also overwrite data in the middle of a stream.
Correct path to clover for Coveralls
It seems php-coveralls will read `build/logs/clover.xml' by default
Use travis-ci.com instead of travis-ci.org