-
Notifications
You must be signed in to change notification settings - Fork 117
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
PHPCS: tests/phpunit/logging/ActionScheduler_wpCommentLogger_Test.php
#1189
PHPCS: tests/phpunit/logging/ActionScheduler_wpCommentLogger_Test.php
#1189
Conversation
@barryhughes Check failure is because of Composer: please re-run. |
@@ -1,10 +1,13 @@ | |||
<?php | |||
// phpcs:disable WordPress.PHP.StrictInArray.MissingTrueStrict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On first glance, the in_array
calls look like they could be made strict, which I think would be preferred over disabling this check for the entire class (or did you find any problems with that)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making them strict caused the tests to fail. The tests seems to be checking that numeric strings work, so need to ignore that sniff in this case.
You can see that by reviewing the checks on commit f97745b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, then I think it still makes more sense to apply the exceptions line-by-line (or, enabling and disabling for blocks of lines like here, where we have three in_array()
calls in a row), rather than excluding the entire file.
This is principally because if at some future point we add additional tests or assertions in this file, we will want to flag any non-strict in_array()
checks.
# Conflicts: # phpcs.xml
@barryhughes PHPUnit setup failure...? |
# Conflicts: # phpcs.xml
# Conflicts: # phpcs.xml
# Conflicts: # phpcs.xml
# Conflicts: # phpcs.xml
No description provided.