Skip to content

NoPagingSniff: False negative when there is no comma after the parameter #713

@rebeccahum

Description

@rebeccahum

Bug Description

There's a false negative when there's no comma after a single item array. For example, this will flag as expected:

$args = array(
	'nopaging'       => true, // Bad.
);

However, this won't:

$args = array(
	'nopaging'       => true // Bad.
);

Minimal Code Snippet

This should flag as an error:

$args = array( 'nopaging' => true );

Error Code

WordPressVIPMinimum.Performance.NoPaging.nopaging_nopaging

Environment

Use php -v and composer show to get versions.

Question Answer
PHP version 7.4.27
PHP_CodeSniffer version 3.6.2
VIPCS version 2.3.3

Tested Against master branch?

  • I have verified the issue still exists in the master branch of VIPCS.
  • I have verified the issue still exists in the develop branch of VIPCS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions