Skip to content

Undefined variable flagged in consecutive lines #203

@paulschreiber

Description

@paulschreiber

I would expect to only see one error here:

16 <?php if ( $error ) : ?>
17 <code><?php echo esc_html( $error ); ?></code>
18 <?php endif; ?>

It's possible this is intentional. I wanted to flag it in case it was not. (This is a WordPress template-part; variables are defined in the parent.)

FILE: template-parts/mail-error.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------
 16 | WARNING | Variable $error is undefined.
    |         | (VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable)
 17 | WARNING | Variable $error is undefined.
    |         | (VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable)
-----------------------------------------------------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions