Skip to content

Squiz.PHP.DisallowMultipleAssignments.Found error when var assignment is on the same line as an open tag #1277

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

Closed
westonruter opened this issue Jan 17, 2017 · 1 comment

Comments

@westonruter
Copy link
Contributor

westonruter commented Jan 17, 2017

The Squiz.PHP.DisallowMultipleAssignments sniff is giving a Found error “Assignments must be the first block of code on a line” for the following code snippet:

<?php $edit_snapshot_text = __( 'Edit Snapshot', 'customize-snapshots' ); ?>

If I put a line break after <?php then it passes:

<?php
$edit_snapshot_text = __( 'Edit Snapshot', 'customize-snapshots' );
?>

I would expect both snippets to not raise errors for Squiz.PHP.DisallowMultipleAssignments.

westonruter added a commit to xwp/wp-customize-snapshots that referenced this issue Jan 17, 2017
@gsherwood gsherwood changed the title Unexpected Squiz.PHP.DisallowMultipleAssignments.Found error Squiz.PHP.DisallowMultipleAssignments.Found error when var assignment is on the same line as an open tag Jan 17, 2017
gsherwood added a commit that referenced this issue Jan 17, 2017
…hen var assignment is on the same line as an open tag
@gsherwood
Copy link
Member

Fixed now. Thanks for the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants