Build on PHP 8.1
Upgrade PHPStan

This commit bumps the version of PHPStan so that development on PHP 8.1
is possible without deprecation notices spamming the log.
Delete PHP 8.0 build (currently failing)
Exclude close/detach from OneZeroInteger mutation

This commit excludes the close() and detach() functions from being
mutated by OneZeroInteger. This is because the previous commit
introduces a bug fix that triggers a false positive with Infection.

See: https://github.com/ancarda/psr7-string-stream/pull/4
f0b0f839 — Johan Meiring 2 years ago
Adjust EOF check to account for possible over-reading
Sync with Packagist
Check-in CI improvements

This commit pulls in ancarda/coverage-enforcer which ensures code
coverage remains at 100%. Additionally, PHPUnit was raised to 9.x and
now has a nicer configuration style.

This brings psr7-string-stream inline with how I do PHP development
these days.
Disable coverage checking on PHP 8.0

To be fixed at a later date
Implement SourceHut CI
Raise minimum PHP to 7.2

Now that 7.2 is EOL, this package drops support for 7.1 and as a result
pulls in newer versions of dev dependencies:

    infection/infection          (0.11.5  => 0.13.6)
    phpstan/phpstan              (0.12.57 => 0.12.64)
    phpstan/phpstan-phpunit      (0.12.16 => 0.12.17)
    phpstan/phpstan-strict-rules (0.12.5  => 0.12.7)
    phpunit/phpunit              (7.5.20  => 8.5.13)

There are no code or functionality changes.
Remove alternative PSR-7 implementations

This commit removes `guzzlehttp/psr7' and `nyholm/psr7'. These two
were pulled in for a now-abandoned unit test that would test multiple
PSR-7 implementations against each other.
Upgrade to PHPStan 0.12
Move to SourceHut

This repo is now hosted on SourceHut.
Instruct CI to build on PHP 7.4
Bump Composer Dependencies

This commit updates the following packages:

    nyholm/psr7                       (1.2.0   => 1.2.1)
    symfony/finder                    (3.4.30  => 3.4.31)
    symfony/debug                     (3.4.30  => 3.4.31)
    symfony/console                   (3.4.30  => 3.4.31)
    nikic/php-parser                  (4.2.3   => 4.2.4)
    nette/finder                      (2.5.0   => 2.5.1)
    phpstan/phpstan                   (0.11.15 => 0.11.16)
    sebastian/exporter                (3.1.1   => 3.1.2)
    phpunit/php-token-stream          (3.1.0   => 3.1.1)
    phpdocumentor/reflection-common   (1.0.1   => 2.0.0)
    phpdocumentor/type-resolver       (0.4.0   => 1.0.1)
    phpdocumentor/reflection-docblock (4.3.1   => 4.3.2)
    phpunit/phpunit                   (7.5.15  => 7.5.16)
    symfony/process                   (3.4.30  => 3.4.31)
    symfony/yaml                      (3.4.30  => 3.4.31)
    composer/ca-bundle                (1.2.3   => 1.2.4)
    symfony/filesystem                (3.4.30  => 3.4.31)
    symfony/config                    (3.4.30  => 3.4.31)
    symfony/stopwatch                 (3.4.30  => 3.4.31)

Additionally, nyholm/psr7 and guzzlehttp/psr7 were pulled in as easy
comparisons with other PSR-7 implementations
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.

Closes #1
Introduce ReadOnlyStringStream

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.