Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug] ForeachArrayMergeSniff throws an error for inline control structure #110

Copy link
Copy link
Closed
@lenaorobei

Description

@lenaorobei
Issue body actions

Steps to reproduce

Run ForeachArrayMergeSniff against file that contains inline control structure.

foreach ([] as $item)
// inline foreach
    $a = array_merge([], []);

foreach ([] as $item)
// array_merge after inline foreach
$a = array_merge([], []);

Expected result

Sniff detects nothing. There is no way to detect function scope without {}.

Actual result

An error occurred during processing; checking has been aborted. The error message was: Undefined index: scope_opener in ...

Metadata

Metadata

Assignees

Labels

acceptedNew rule is acceptedNew rule is acceptedbugSomething isn't workingSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.