Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make package compatible with stream interface Compatibility stream interface v2 #75

Merged
merged 10 commits into from
Sep 1, 2024

Conversation

andrew-demb
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? yes (for extenders of the \Http\Client\Socket\Stream class)
Deprecations? no
Related tickets fixes #68
Documentation -
License MIT

What's in this PR?

Replaces #72

Fixes compatibility with psr/http-message v2

Why?

For now, the current package contains implementation for the \Psr\Http\Message\StreamInterface, but there's no mention of supported versions of psr/http-message in composer.json.

After some upgrades of php-http/httpplug - they declared compatibility with psr/http-message v2 and the current package was broken if the project installed it with psr/http-message v2 (see mentioned issue)

Checklist

  • Updated CHANGELOG.md to describe BC breaks/deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

@andrew-demb
Copy link
Contributor Author

/cc @dbu

composer.json Outdated Show resolved Hide resolved
@andrew-demb
Copy link
Contributor Author

$ vendor/bin/phpunit
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

SSSSS............................................................ 65 / 89 ( 73%)
........................                                          89 / 89 (100%)

Time: 00:21.389, Memory: 10.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 89, Assertions: 901, Skipped: 5.

CHANGELOG.md Outdated Show resolved Hide resolved
@dbu
Copy link
Contributor

dbu commented Sep 1, 2024

thanks a lot! ok to make this 2.3 instead of 3.0?

and can you see if you can fix the phpstan complaint? looks like we miss some sanity check (or have incorrect annotations somewhere)

@andrew-demb
Copy link
Contributor Author

ok to make this 2.3 instead of 3.0?

I'm Ok with documenting minor BC break for extenders of the Stream class (which overrides methods with added native return types) and release it with 2.x release.

@andrew-demb
Copy link
Contributor Author

and can you see if you can fix the phpstan complaint? looks like we miss some sanity check (or have incorrect annotations somewhere)

Done.

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your contribution!

i will adjust the changelog and add the @internal after merging.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@dbu dbu merged commit 1f8fecc into php-http:2.x Sep 1, 2024
11 checks passed
@dbu
Copy link
Contributor

dbu commented Sep 1, 2024

released as https://github.com/php-http/socket-client/releases/tag/2.3.0

@andrew-demb andrew-demb deleted the compatibility-stream-interface-v2 branch September 1, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal Compile Error: Declaration of Http\Client\Socket\Stream::close() must be compatible
2 participants