Skip to content

[CodeQuality] Skip same local method call in InlineIfToExplicitIfRector - #8417

Merged
TomasVotruba merged 1 commit into
mainfrom
skip-same-local-method-call-inline-if
Aug 30, 2026
Merged

[CodeQuality] Skip same local method call in InlineIfToExplicitIfRector#8417
TomasVotruba merged 1 commit into
mainfrom
skip-same-local-method-call-inline-if

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Skip conversion when both sides of the boolean expression are $this->foo(...) method calls of the same name.

$this->validateMimeType($asset->getRemoteMimeTypeFromHeader())
    && $this->validateMimeType($asset->getRemoteMimeTypeFromMagicBytes());

Such combined validation reads better as a single expression than split into an explicit if.

Skip when both sides of the boolean expression are `$this->foo(...)`
calls of the same name, e.g.

    $this->validateMimeType($asset->getRemoteMimeTypeFromHeader())
        && $this->validateMimeType($asset->getRemoteMimeTypeFromMagicBytes());

Claude-Session: https://claude.ai/code/session_01D93PXDaqua1utm7H8KyJAN
@TomasVotruba
TomasVotruba merged commit 13cbd81 into main Aug 30, 2026
44 checks passed
@TomasVotruba
TomasVotruba deleted the skip-same-local-method-call-inline-if branch August 30, 2026 09:17
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