Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Jan 2, 2026

declare() can have its stmts property filled with array of stmts, eg:

declare(ticks=1) {
    echo 'test';
    die;

    echo 'unreachable';
}

this currently skipped on loop of stmts, for example on RemoveUnreachableStatementRector

see example:

This PR add Declare_ to NodeGroup::STMTS_AWARE so it can properly processed.

@samsonasik
Copy link
Member Author

@TomasVotruba ready 👍

@samsonasik samsonasik changed the title [StmtsAware] Add Declare_ to NodeGroup::STMTS_AWARE to allow remove Declare_ stmts [StmtsAware] Add Declare_ to NodeGroup::STMTS_AWARE to allow process its stmts Jan 2, 2026
@TomasVotruba TomasVotruba merged commit 9116b3e into main Jan 2, 2026
58 checks passed
@TomasVotruba TomasVotruba deleted the dead-code branch January 2, 2026 12:40
@TomasVotruba
Copy link
Member

LGTM 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants