Skip to content

[DeadCode] Skip constant compare from vendor/ on NarrowWideUnionReturnTypeRector#8056

Open
samsonasik wants to merge 2 commits into
mainfrom
skip-constant-compare
Open

[DeadCode] Skip constant compare from vendor/ on NarrowWideUnionReturnTypeRector#8056
samsonasik wants to merge 2 commits into
mainfrom
skip-constant-compare

Conversation

@samsonasik

Copy link
Copy Markdown
Member

When constant vendor can be different value, eg allow monolog v2 and v3:

"monolog/monolog": "^2.0 || ^3.0"

The Logger::API value are different. So this check is on purpose:

    public function createLogRecord(int $level): array|LogRecord
    {
        return Logger::API === 2
            ? ['level' => $level]
            : new LogRecord();
    }

and should be skipped.

@samsonasik samsonasik requested a review from TomasVotruba June 19, 2026 19:08
@samsonasik

Copy link
Copy Markdown
Member Author

@TomasVotruba ready 👍

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant