Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds more precise types for some parts of the package. This PR specifically targets only places that are not generated by the
GenerateEndpoints
script (this will be covered by a separate PR solving #217).I found those by running phpstan at level 6 (instead of the existing config using level 5). This PR does not solve all non-endpoints errors of level 6:
void
return types on test methods themselves)SerializerInterface::deserialize
as I'm not sure about the correct type:$body
has a native type?string
but the phpdoc type saysstring
and implementations don't seem to account fornull
(so maybestring
is the expected type$headers
as callers are passing$response['transfer_stats']
there (while ringphp documents that response headers are in$response['headers']
)Connection
because dealing with RingPhp responses is complex.Those can be solved later (before enabling level 6)
Issues Resolved
n/a
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.