-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Declare strict types #2365
Declare strict types #2365
Conversation
- linesBefore -> spacingBefore - linesAfter -> spacingAfter
Hi, I do not understand why we can't have them public? It is configurable, as it was requested before... see: #1771 (comment) |
see this comment : #1771 (comment) |
@floverdevel For me it is unclear. I don't know if @gsherwood changed his mind and he doesn't want to have this sniff configurable anymore? |
I commented on the other PR that I wanted changes to how the configuration works because the proposed public properties (specifically |
@gsherwood ok, so basically you want make |
That's not what I said at all. Please read my comment here: #1771 (comment) |
@gsherwood sorry, I am so lost... I just understand you don't like
and I think these are quite useful. |
Even more maybe we should be able to allow strict type declaration in the same line as php open tag, I've seen some people/project are doing it, no it's not possible. |
Is this a thing that really needs to be done? |
Yes, it needs to be done for PHPCS to complete its PSR-12 standard. |
My comments related only to the I never said that the |
@gsherwood Ok, all clear now. So I've changed |
After reviewing this sniff again, the use of the property to check the format of the declare statement made it impossible to properly report and fix errors. Instead, the sniff needed to be rewritten to enforce each of the individual rules of the PSR-12 standard so each message could have a different error code and fix. This also lets it account for PHPCS annotations much more easily. So I've decided not to merge this PR, but it was very helpful in figuring out what needed to be done. Thank you to those who contributed. I know this took a long time to get done, but hopefully the sniff that goes into 3.5.0 properly enforces declare formatting and has been written to enable customisation in the future. |
@gsherwood I've just had a look at the sniffs which were added to PHPCS 3.5.0, but - in contrast to what was discussed here -, the formatting sniff now merged does not allow for any customization in spaces required on the inside of parenthesis, around the |
Yes, it was an intentional decision to code this for PSR-12's rules only so it could be done in the time allowed. |
@gsherwood Would you be open to a PR at a later time to add the properties as discussed above ? |
Yes |
Hello !
Since #1771 seems not to be be going forward, i forked it, rebased on master and added a commit to remove the public members of the class that were mentioned by @gsherwood here : #1771 (comment)