Disallow use function and use const - #188
Conversation
Well, didn't build it just for you, but glad you like it. ;-) |
use functionuse function and use const
| "minimum-stability": "dev", | ||
| "prefer-stable": true, |
There was a problem hiding this comment.
Are these changes intentional? Neither of them will have any effect if the project isn't the root project.
There was a problem hiding this comment.
They were, yes. phpcsextra is only released as alpha and it wouldn't install without adding these in: https://github.com/PHPCSStandards/PHPCSExtra/releases
There was a problem hiding this comment.
OK, we'll have to hold on releasing this then until phpcsextra is released, as the minimum-stability won't flow through, and would make the coding standards uninstallable as a dependency.
|
Requested a stable release: PHPCSStandards/PHPCSExtra#91 |
|
@roborourke and cc @rmccue for the legacy piece -- we still want this? Could probably get it in now with a refreshed patch |
|
Unless there are newer releases then yes I think so. Is it still needed even with the latest WPCS versions? I can't remember the logic behind disallowing them but I don't care that much personally. |
|
👍 to refreshing this so it can be merged. Our coding standards are pretty explicit about this:
and it would be nice to have this enforced by phpcs rather than discussing case by case. |
|
Yep, still an intentional part of the standards so +1 to getting it in |
This addition disallows developers from using functions, while keeping the ability to
usenamespaces and constants.Special thanks to @jrfnl for building this ruleset for us and making this so easy to use!