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

PHPCS/Psalm: Figure out how to reconcile $_unused_ var name prefixes in child classes with Psalm static analysis #8956

Closed
reykjalin opened this issue Jun 13, 2024 · 3 comments
Labels
category: devops Features and tools supporting dev process. focus: architecture Product architecture and engineering best practices priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.

Comments

@reykjalin
Copy link
Contributor

Description

While working on #8955 @timur27 found that using the suggested $_unused_ prefix in child classes results in Psalm reporting an issue due to a parameter name mismatch (see #8955 (comment)).

Expected behavior

You should be able to use the $_unused_ prefix to explicitly mark function parameters as unused, even in child classes, without generating further errors during static analysis.

Actual behavior

Psalm reports an issue due to a mismatch in parent function parameter names and the child implementation.

@anu-rock
Copy link
Contributor

This issue is about product architecture & common problems. Sending it to @Automattic/transact-architecture (ping @jrodger) as per our product responsibilities Pc2DNy-3z-p2.

@anu-rock anu-rock added the focus: architecture Product architecture and engineering best practices label Jun 14, 2024
@marcinbot
Copy link
Contributor

See the comment here: #8955 (comment)

The sniffer's behaviour is correct. It highlights a problem with the class structure that we've come to rely on.

I'll close this in favor of V2 - hopefully this will be less prevalent there with more thought-through approaches.

@reykjalin
Copy link
Contributor Author

Thanks for jumping in here so quickly @marcinbot 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: devops Features and tools supporting dev process. focus: architecture Product architecture and engineering best practices priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

3 participants