-
-
Notifications
You must be signed in to change notification settings - Fork 187
[PHPStanRules] Add RequireStringArgumentInConstructorRule #2968
[PHPStanRules] Add RequireStringArgumentInConstructorRule #2968
Conversation
Hmm, I don't really think this is worth it to be honest. |
PHPStan is hard at first use, but very addictive in time :) How would you refactor it? |
packages/phpstan-rules/src/Rules/RequireStringArgumentInConstructorRule.php
Outdated
Show resolved
Hide resolved
packages/phpstan-rules/src/Rules/RequireStringArgumentInConstructorRule.php
Show resolved
Hide resolved
Could you update the PR title to include the package? The code itself looks very good 👍 |
I don't agree that moving this single function to a new service that we use in both this rule and RequireStringArgumentInMethodCallRule will make it better or easier to understand. |
@ruudk I see. If you're able to put that in code, feel free to update the PHPStan rule |
This can be used in Rector to prevent issues with prefixing. See rectorphp/rector#5596 and rectorphp/rector#5597
e69481b
to
052cfde
Compare
052cfde
to
b0675d2
Compare
@TomasVotruba It's ready. |
packages/phpstan-rules/src/Rules/RequireStringArgumentInConstructorRule.php
Outdated
Show resolved
Hide resolved
packages/phpstan-rules/src/Rules/RequireStringArgumentInConstructorRule.php
Outdated
Show resolved
Hide resolved
Applied feedback, ✅ green |
This one is also ready for review After this I will create a PR to enable it for Rector. It probably needs to wait before Symplify is tagged again? |
It seems 2 comments are not displaying: #2968 (comment) |
Should I also update the docs or is this done automatically? |
@TomasVotruba Ready ✅ |
Thank you 👍 |
This can be used in Rector to prevent issues with prefixing.
See rectorphp/rector#5596 and rectorphp/rector#5597