Problem/Motivation

The custom sniff Drupal.WhiteSpace.OperatorSpacing does not allow to use declare(strict_types=1);

The default sniff Squiz.WhiteSpace.OperatorSpacing already allow this since https://github.com/squizlabs/PHP_CodeSniffer/issues/1163.

Furthermore the custom sniff Drupal.WhiteSpace.OperatorSpacing specifies Overrides Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff to allow the plus operator on numbers like "$i = +1;". but the default one seems to also allow this.

The question is: Is it still necessary to override Squiz.WhiteSpace.OperatorSpacing?

Proposed resolution

  • Yes: We should update Drupal.WhiteSpace.OperatorSpacing to allow declare(strict_types=1);
  • No: Remove Drupal.WhiteSpace.OperatorSpacing

Remaining tasks

  1. Take a decision
  2. Apply it

I'll be happy to provide the patch :)

User interface changes

None

API changes

None?

Data model changes

None

Release notes snippet

TODO

Comments

beram created an issue. See original summary.

klausi’s picture

Thanks for opening this issue!

If we can remove Drupal.WhiteSpace.OperatorSpacing then we should do it. If we have test cases for it we should move them to good.php and bad.php then.

If it turns out that we can't remove it then fixing it is fine to allow declare(strict_types=1);.

Please create a pull request against https://github.com/pfrenssen/coder , then we see the automated test cases run.

beram’s picture

See https://github.com/pfrenssen/coder/pull/62 :)

Off topic: I did not know that coder was on github! Could it be interesting to add the repository URL on the project page? I would have directly provided the PR instead if I've known this ^^

  • klausi committed 74757b9 on 8.x-3.x authored by beram
    refactor(OperatorSpacing): remove `Drupal.WhiteSpace.OperatorSpacing` in...
klausi’s picture

Status: Active » Fixed
Issue tags: +Amsterdam2019

Thanks, merged!

Good point about the project page, will try to link Github better there :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

BR0kEN’s picture