Improved strictness of URLChecker HTTPHandler and URL Value Object #427
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:
I've noticed that PHPStan after its release fails for HTTPHandler class which is a part of URLChecker feature introduced in 2017.
Instead of updating baseline's message, I've resolved the issue at hand, that is safe to resolve. This class requires further improvements, however they would require QA involvement, so out of scope of fixing CI right now.
Given the LogicException introduced there needs more verbose information, I've added strict types to
URL
value object. Using there$url->url
would add more to technical debt as there are no@property-read
s on that VO. Accessing properties via magic getter is deprecated.I've tried also to declare strict types for that VO's properties, however that exploded in many different directions, so it's safer to process such change as a follow-up, when there's more time.