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

Improved strictness of URLChecker HTTPHandler and URL Value Object #427

Merged
merged 4 commits into from
Sep 17, 2024

Conversation

alongosz
Copy link
Member

@alongosz alongosz commented Sep 17, 2024

🎫 Issue n/a

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-reads 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.

@alongosz alongosz force-pushed the fix-url-checker-http-handler-phpstan-issue branch from b1c1726 to d92c27a Compare September 17, 2024 10:53
Copy link

@alongosz alongosz changed the title Fixed strict types for URLChecker HTTPHandler::createCurlHandlerForUrl Improved strictness of URLChecker HTTPHandler and URL Value Object Sep 17, 2024
@alongosz alongosz requested review from a team and lserwatka September 17, 2024 11:33
@mikadamczyk mikadamczyk requested a review from a team September 17, 2024 11:41
@alongosz alongosz merged commit 96f656c into main Sep 17, 2024
15 checks passed
@alongosz alongosz deleted the fix-url-checker-http-handler-phpstan-issue branch September 17, 2024 12:45
barw4 pushed a commit that referenced this pull request Oct 17, 2024
)

For more details see #427

Key changes:

* Fixed strict types for URLChecker HTTPHandler::createCurlHandlerForUrl

* Introduced strict getters for URL ValueObject

* Improved LogicException message

* [PHPStan] Aligned baseline with the changes
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.

5 participants