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

Introduced NoConfigResolverParametersInConstructorRule PHPStan custom rule #1

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

konradoboza
Copy link
Collaborator

@konradoboza konradoboza commented Dec 10, 2024

🎫 Issue -

Description:

Introduced our first custom rule to PHPStan. It guards referring to config resolver parameters in constructor (usage of methods: hasParameter and getParameter).

Note: I decided to make it nonIgnorable which means it cannot be put into baseline. To me it is should be enforced rather than suggested as SiteAccess scope change might corrupt the actual outcome.

composer phpstan will produce the following:

Zrzut ekranu 2024-12-11 o 15 34 31

Moreover I provided PHPUnit coverage aligned with recommendations, ref: https://phpstan.org/developing-extensions/testing#custom-rules.

For QA:

Documentation:

@konradoboza konradoboza self-assigned this Dec 10, 2024
@konradoboza konradoboza force-pushed the added-custom-constructor-phpstan-rule branch from e8f93cc to f14626c Compare December 11, 2024 10:02
@konradoboza konradoboza changed the title Introduced NoConfigResolverInConstructorRule PHPStan custom rule Introduced NoConfigResolverParametersInConstructorRule PHPStan custom rule Dec 11, 2024
@konradoboza konradoboza force-pushed the added-custom-constructor-phpstan-rule branch from f14626c to 4b474f3 Compare December 11, 2024 14:19
@konradoboza konradoboza force-pushed the added-custom-constructor-phpstan-rule branch 3 times, most recently from 6a530fb to a955ed4 Compare December 11, 2024 14:24
@konradoboza konradoboza force-pushed the added-custom-constructor-phpstan-rule branch from a955ed4 to 4c7346d Compare December 11, 2024 14:29
@konradoboza konradoboza requested a review from a team December 11, 2024 14:38
@konradoboza konradoboza requested a review from a team December 11, 2024 14:55
.github/workflows/backend-ci.yaml Outdated Show resolved Hide resolved
composer.json Show resolved Hide resolved
@konradoboza konradoboza changed the base branch from main to 4.6 December 12, 2024 10:49
@konradoboza konradoboza requested review from alongosz and a team December 12, 2024 10:49
@alongosz alongosz requested a review from a team December 12, 2024 12:26
@konradoboza konradoboza merged commit dc4f0a0 into 4.6 Dec 12, 2024
3 of 5 checks passed
@konradoboza konradoboza deleted the added-custom-constructor-phpstan-rule branch December 12, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants