-
Notifications
You must be signed in to change notification settings - Fork 7
Some changes to achieve compatibility with php8.0 #4
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
Conversation
rkrx
commented
May 27, 2021
- Fixed some issues reported by phpstan (missing return types)
- Composer: Raised phpunit to ^8.0
- Composer: php-http/mock-client is now regularly provided in the latest version. Min = 1.4.1, which is compatible from 7.1 up to 8.0
- Composer: phpstan is now regularly provided in the latest version
- Composer: Added script section for phpstan
- Added meaningful phpstan.neon
- Composer: Raised phpunit to ^8.0 - Composer: php-http/mock-client is now regularly provided in the latest version. Min = 1.4.1, which is compatible from 7.1 up to 8.0 - Composer: phpstan is now regularly provided in the latest version - Composer: Added script section for phpstan - Added meaningful phpstan.neon
…of method Psr\Http\Message\StreamFactoryInterface::createStream() expects string, string|false given."
…returnOrder with type JsonSerializable is not subtype of native type Dhl\Sdk\Paket\Retoure\Model\RequestType\ReturnOrder."
…ase::assertStringContainsString
Thank you for your contribution @rkrx Your fork currently fails to install, caused by the change to the
Another installation issue occurs when using PHP 7.1, which is supported by this package.
Our packages are built to support the same PHP versions for dev and project use. That is why the dev requirements are locked to older versions. We cannot validate PHP version support if the quality tools (dev requirements) fail to install/run in that environment. The solution is to either define the dev requirements so that all the range from 7.1 to 8.0 is supported or create a new package version that drops PHP 7.1 support. However, the mock client issue is still a blocker for quite a while now: |
Ah ok, I was wondering. This was also a problem with the previous version IIRC. I added guzzle while I was testing php 8.0 version support locally.
Yes, that is annoying. PHPUnit only supports a certain range of versions - all officially supported php versions. This is not a direct problem when using dhl/sdk-api-bcs-returns as a dependency as the require-dev-part wont be evaluated in that case. Only if you do a first level install. |
That is impossible. You cannot execute the tests with no mock client. Replacing the mock client by a real HTTP client is not an option. As mentioned before, I am open to dropping PHP 7.1 support in favor of PHP 8.0 – pretty sure one day that will happen anyway. My point is, we have to put this on hold until a PHP 8 and PSR-18 compatible mock client becomes available. |
Wait, you missunderstood me. You've mentioned this:
If you add any http-client (guzzle or some other) this error-message goes away. This is what I did. I removed this dependency once I was ok with my changes.
You dont have to. All you have to do is to have some script to install phpunit 7 instead of 8 while in CI-test-mode for php 7.1. All projects out there using Not sure if |
I did understand at second read but that's a hack. I will not add a package to the library without actually using it, just to match the virtual package requirements. I will also not make modifications to the CI (which builds dozens of projects in various runtime variations) to, under some circumstances, use tools that are not listed in the dev requirements. We will evaluate alternative mock clients if there is no progress with Again, thank you for your contribution. I hope we can review & merge this PR at a later date. |
I just made a temporary meta-package available for php-http/mock-client, which basically just adds a provide-section for psr/http-client-implementation.
And I made two changes for the test-cases. |
Closing this as this package is compatible with PHP 8.0 as of v2.1.0 |