Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Match Rule Descriptions with Configuration Parameters in README.md #265

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

Merged
ondrejmirtes merged 2 commits into phpstan:2.0.x from OsitaDNU:improve-rule-descriptions
Mar 30, 2025

Conversation

@OsitaDNU
Copy link
Contributor

@OsitaDNU OsitaDNU commented Mar 17, 2025

Hi,

I watched your video on stricter rules in PHPStan and wanted to configure the rules I needed. However, I found it difficult to match the configuration parameters to their corresponding rule descriptions. I also checked the documentation but couldn’t find where these parameters were defined.

To improve clarity, I’ve put the rule descriptions into a table and tried to match them with their respective configuration parameters. This should make it easier to understand which settings control each rule.

However, I couldn’t match the following parameters to any rule descriptions:

  • uselessCast
  • disallowedImplicitArrayCreation
  • strictArrayFilter
  • illegalConstructorMethodCall

Additionally, I couldn’t match the following rule descriptions to a specific parameter:

  • "Correct case for referenced and called function names."
  • "Contravariance for parameter types and covariance for return types in inherited methods (Liskov substitution principle - LSP)."
  • "Check LSP even for static methods."

Could you review my matches to ensure they are correct? Also, any help in completing the missing mappings would be appreciated. Thanks!

hrach reacted with heart emoji
README.md Outdated
| | Check LSP even for static methods. |
| `requireParentConstructorCall` | Require calling parent constructor. |
| `disallowedBacktick` | Disallow usage of backtick operator (`` $ls = `ls -la` ``). |
| `closureUsesThis` | Closure should use `$this` directly instead of using `$this` variable indirectly. |
Copy link
Member

@ondrejmirtes ondrejmirtes Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if the table was also formatted nicely in markdown.

OsitaDNU reacted with thumbs up emoji
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 3a4a228

Copy link
Member

Unfortunately it's still not very readable.

Screenshot 2025年03月18日 at 10 36 41

Copy link

hrach commented Mar 18, 2025

A note: use spaces instead of tabs and IntelliJ/PHPStorm/... can this format automatically.

OsitaDNU reacted with thumbs up emoji

Copy link
Contributor Author

@ondrejmirtes Okay, I can fix it. Given the issues so far, I just want to confirm if everyone is happy with a table format. See screenshot below... there will be a horizontal scroll bar. Alternatively, I can list each rule description with the parameter as the header. Let me know your thoughts. Cc @hrach
image

Copy link
Member

Would be better if the text in the 2nd column wrapped instead of causing horizontal scrolling.

OsitaDNU reacted with thumbs up emoji

Copy link
Member

Please solve the conflict, there was a new parameter added meanwhile.

OsitaDNU reacted with thumbs up emoji

Copy link
Contributor Author

Hi, I've fixed the conflict. Should be good to go now. Thanks

@ondrejmirtes ondrejmirtes merged commit f203fec into phpstan:2.0.x Mar 30, 2025
31 checks passed
Copy link
Member

Thank you!

OsitaDNU reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ondrejmirtes ondrejmirtes ondrejmirtes requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /