Coding Standards: Fix all WordPress.CodeAnalysis.AssignmentInCondition issues.

`WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition` can be ignored, as this is allowed in Core.

See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45601 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-07-05 03:13:31 +00:00
parent e6b7205a8f
commit 027c9dae90
2 changed files with 6 additions and 1 deletions

View File

@ -184,6 +184,11 @@
</properties>
</rule>
<!-- Assignments in while conditions are a valid method of looping over iterables -->
<rule ref="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Exclude the unit tests from select sniffs. -->
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>/tests/phpunit/tests/*</exclude-pattern>

View File

@ -156,7 +156,7 @@ function wp_save_post_revision( $post_id ) {
* @param WP_Post $last_revision The last revision post object.
* @param WP_Post $post The post object.
*/
if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', $check_for_changes = true, $last_revision, $post ) ) {
if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $last_revision, $post ) ) {
$post_has_changed = false;
foreach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) {