Skip to content

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

@westonruter

Description

@westonruter

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.

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